[Release] Area of Patrol - Set AOP - Ft. Draw Text, Peacetime & More [AOP] [3.4]

can i have the location settings for the location its at in the screenshots

@FAXES, The IRL time I noticed has been unsynced lately with my PC system, it used to be then stopped, then I updated the script and it still is not synced, however it is a different unsynced time than before, still not synced to my PC system like you said. Idk what is wrong, or where I can check to see if something is off, but I definitely does not match the time my PC says.

@nathangladney

It’s in the client.lua

@KSA01 I believe the native is broken as I have not touched it at all.

2 Likes

It was telling me it was 12 hours ahead of my time. Saying the time zone it was in was iceland. Im est. If you have the same issue with 4 hours ahead. Here is a quick fix

Citizen.CreateThread(function()
    while true do
    year, month, day, hour, minute, second = GetLocalTime()
        Citizen.Wait(1)
        local hourX = ""
        if hour == 0 then
            hourX = 20
        elseif hour == 1 then
            hourX = 21
        elseif hour == 2 then
            hourX = 22
        elseif hour == 3 then
            hourX = 23
        elseif hour == 4 then
            hourX = 00
        elseif hour == 5 then
            hourX = 1
        elseif hour == 6 then
            hourX = 2
        elseif hour == 7 then
            hourX = 3
        elseif hour == 8 then
            hourX = 4
        elseif hour == 9 then
            hourX = 5
        elseif hour == 10 then
            hourX = 6
        elseif hour == 11 then
            hourX = 7
        elseif hour == 12 then
            hourX = 8
        elseif hour == 13 then
            hourX = 9
        elseif hour == 14 then
            hourX = 10
        elseif hour == 15 then
            hourX = 11
        elseif hour == 16 then
            hourX = 12
        elseif hour == 17 then
            hourX = 13
        elseif hour == 18 then
            hourX = 14
        elseif hour == 19 then
            hourX = 15
        elseif hour == 20 then
            hourX = 16
        elseif hour == 21 then
            hourX = 17
        elseif hour == 22 then
            hourX = 18
        elseif hour == 23 then
            hourX = 19
        end
        local player = GetPlayerPed(-1)
        if peacetimeActive == true then
            -- DisableControlAction(2, 37, true) -- tab
            if IsControlPressed(0, 106) then
                ShowInfo("~r~Peacetime is enabled. ~n~~s~You can not shoot.")
            end
		    DisablePlayerFiring(player, true)
            DrawTextAOP(0.660, 1.430, 1.0,1.0,0.45, "~p~Time: ~w~" .. hourX .. ":" .. minute .. " ~p~| Date: ~w~" .. day .. "~p~/~w~" .. month .. "~p~/~w~" .. year, 255, 255, 255, 255)
            DrawTextAOP(0.660, 1.458, 1.0,1.0,0.45, "~w~Current ~r~AOP: ~w~" .. FaxCurAOP .. " " .. FaxCurAOP2 .. " ~p~| ~w~PeaceTime: ~g~Enabled", 255, 255, 255, 255)
        elseif peacetimeActive == false then
            EnableControlAction(2, 37, true) -- tab
            DrawTextAOP(0.660, 1.430, 1.0,1.0,0.45, "~p~Time: ~w~" .. hourX  .. ":" .. minute .. " ~p~| Date: ~w~" .. day .. "~p~/~w~" .. month .. "~p~/~w~" .. year, 255, 255, 255, 255)
            DrawTextAOP(0.660, 1.458, 1.0,1.0,0.45, "~w~Current ~r~AOP: ~w~" .. FaxCurAOP .. " " .. FaxCurAOP2 .. " ~p~| ~w~PeaceTime: ~r~Disabled", 255, 255, 255, 255)
        end
	end
end)

There was probably a way better way to do this but it works

2 Likes

It’s a FiveM issue I believe. For me it’s 2 hours some it’s 4 hours and more it’s 6…

I’ll look at it more when I’m home but otherwise I have no clue

2 Likes

Shwweet. Also, can you maybe try to figure out how to have it display a “0” instead of nothing at all? (example) 21:02 instead of 21:2 ? I just seems to not like to put a nil if it REALLY doesn’t have to 0.o Right now I might just use " . " in place lol

2 Likes

Add something like this just before displaying the time:

local visualMinute = minute
if minute < 10 then
    visualMinute = "0" .. minute
end

And use visualMinute as the minute value.

3 Likes

Doable I kinda rushed the time function :laughing:

2 Likes

Ok thx I’m going to try it when I’m at my work where my server is

@glitchdetector Ah yes, es muy bueno. Thank you! Works like a charm. I would upload a screen shot but I forgot to take one and now its 20:10 soooooooo. Im beat. lol

Release 2.3

  • Added config.lua
  • Added config to disable the ‘no shooting during peacetime’ function
  • Fixed time Thanks to @glitchdetector
  • Cleaned up some code
  • Fixed /aopvote issue

Downloads in OP

2 Likes

my time still is like 12 hrs off
and that server has the right time

again implementation of admins would be great i have allready done this, however its simple to do so, with the downloads saying no permission or the permission version wont make any difference for people

What do you mean by this?

@ThaRook if you look above I did respond to that question.

1 Like

how do you move the text around/ Like if I wanted in on the bottom center of my screen.

2 Likes

Edit The Text Draw Numbers in the client.lua file

3 Likes

help i installed this for my server and it says not allowed but the other word that i don’t know how to spell

did you set up Ace perms? If not look at the wiki link in the OP

1 Like

I have changed the command in chat from /AOP to something else so that it cannot be changed by people who know the command. It changes the AOP in chat but does not change at the bottom of the screen, Do you know how to fix this :slight_smile:

Why not just add a white-list system with either, steamid or ace perms?