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

Peacetime is something I plan to release in it…

1 Like

Anyway I could get ya to share? Haha.

Yes… as long as if i was to change the time for instance to morning it would switch to next day like how this one does it [Release] Time And Date Display v0.4… and it work with vsync

I have been using irl time not ingame time…

2 Likes

I suppose it was just a suggestion. It would help take 2 resources to 1…

2 Likes

It is easy to use in real game time I have that, I just used IRL time so you could see it as Faxes resource.

3 Likes

I added everything correctly from how you described. When I join the server it says I am owner rank and am able to bypass the blacklisted items, but when I try to use /aop or /svr5 (for server restart notification) it says insufficient permission like 4 times in chat. If you can take a look at my code I followed it exactly I think and don’t know what the issue is.

perms.cfg

### Fax Core Permissions config, made by FAXES ###
#
### Do not touch this section
set Fax-Core true
start Fax-Core
### This sets the groups DO NOT TOUCH ###
add_ace Fax.owner owner allow	                            		    # sets ace permission for owners
add_ace Fax.snradmin snradmin allow	                            		# sets ace permission for snradmins
add_ace Fax.fadmin fadmin allow	                                    	# sets ace permission for admins
add_ace Fax.member3 member3 allow	                            		# sets ace permission for member3
add_ace Fax.member2 member2 allow	                            		# sets ace permission for member2
add_ace Fax.member1 member1 allow	                            		# sets ace permission for member1

### Start editing below, Don't have the same ID in 2 groups.
### Add People to Owner
add_principal identifier.steam:11000010a5ac50f Fax.owner             	# add to the owner group
add_principal identifier.steam:11000010d291cae Fax.owner                # add to the owner group

### Add People to Senior Admin
add_principal identifier.steam:110000000000000 Fax.snradmin             # add to the senior admin group
add_principal identifier.steam:110000000000000 Fax.snradmin            	# add to the senior admin group

### Add People to Admin
add_principal identifier.steam:110000000000000 Fax.fadmin               # add to the admin group
add_principal identifier.steam:110000000000000 Fax.fadmin               # add to the admin group

### Add People to Member 3
add_principal identifier.steam:110000000000000 Fax.member3              # add to the member 3 group
add_principal identifier.steam:110000000000000 Fax.member3              # add to the member 3 group

### Add People to Member 2
add_principal identifier.steam:110000000000000 Fax.member2              # add to the member 2 group
add_principal identifier.steam:110000000000000 Fax.member2              # add to the member 2 group

### Add People to Member 1
add_principal identifier.steam:110000000000000 Fax.member1              # add to the member 1 group
add_principal identifier.steam:110000000000000 Fax.member1              # add to the member 1 group

server.cfg

# you probably don't want to change these!
# only change them if you're using a server with multiple network interfaces
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

start mapmanager
start chat
start spawnmanager
start sessionmanager
start fivem
start hardcap
start β– β– β– β– β– β– β– 
start scoreboard
start playernames
start synn-loadscreen-master
start streetLabel
start frfuel
start fax-aop-16
start fax-restart
start deleteveh
start assets
start crouch
start basic

sv_scriptHookAllowed 1

# change this
rcon_password ***********

# a comma-separated list of tags for your server
# for example: sets tags "drifting, cars, racing" or sets tags "roleplay, military, tanks"
sets tags "default"

# set an optional server info and connecting banner image url.
# size doesn't matter, any banner sized image will be fine.
#sets banner_detail "http://url.to/image.png"
#sets banner_connecting "http://url.to/image.png"

sv_hostname "Missouri State RP | Coming Soon"

# nested configs!
#exec server_internal.cfg
exec perms.cfg

# loading a server icon (96x96 PNG file)
load_server_icon myLogo.png

# convars for use from script
set temp_convar "hey world!"

# disable announcing? clear out the master by uncommenting this (your server will not be listed in the serverlist if you uncomment this!)
#sv_master1 ""

# want to only allow players authenticated with a third-party provider like Steam (don't forget, Social Club is a third party probvider too!)?
#sv_authMaxVariance 1
#sv_authMinTrust 5

# add system admins
add_ace group.admin command allow # allow all commands
add_ace group.admin command.quit deny # but don't allow quit
add_principal identifier.steam:11000010d291cae group.admin # add the admin to the group

# remove the # to hide player endpoints in external log output
sv_endpointprivacy true

# server slots limit (must be between 1 and 31)
sv_maxclients 30

# license key for server (https://keymaster.fivem.net)
sv_licenseKey ******************************

#AOP#

add_ace group.admin fax allow               # allow all commands for FAXES Script admins 
add_ace group.moderator fax allow           # allow all commands for FAXES Script moderators
add_ace group.moderator fax.cmds deny	    # disallow FAXES Script Perms for moderators

add_principal identifier.steam:11000010d291cae group.admin

For the update you just made. Is there a way to make it so we don’t need to add perms that way everyone can do it.

how to change colors?

edit:
nvm found it

List

~r~ = Red
~b~ = Blue
~g~ = Green
~y~ = Yellow
~p~ = Purple
~o~ = Orange
~c~ = Grey?
~m~ = Darker Grey
~u~ = Black
~n~ = New Line
~s~ = Default White
~h~ = Bold Text

Β¦ = Rockstar Verified Icon
Γ· = Rockstar Icon
βˆ‘ = Rockstar Icon 2

4 Likes

No perms version. I will update after the next update

2 Likes

What about the code in the scripts

2 Likes

Update 1.7 / 1.7.3

  • Added peacetime to draw text on screen
  • Added date
  • Moved the draw text to 2 lines
  • Re-released the no perms version (1.7.3)

2 Likes

server.lua for Restart Script

----------------------------------------
-- Server Notification, Made by FAXES --
----------------------------------------

-- Config Area --

rPeacetime = true		-- Enables the peacetime command(s) Values: true, false

-- Code --
AddEventHandler('chatMessage', function(source, name, msg)

-- Server Restart Commands List Command
RegisterCommand("svrlist", function()
	if IsPlayerAceAllowed(source, "fax.cmds") then
		TriggerClientEvent('RestartList', source)
	else
		TriggerClientEvent('Restart:NoPerms', source)
	end
end)

-- Server Restart in 5 Mins Command
RegisterCommand("svr5", function()
	if IsPlayerAceAllowed(source, "fax.cmds") then
		TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n SERVER RESTART IN 5 MINUTES \n Please Finish Your Current RP Scenario \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
	else
		TriggerClientEvent('Restart:NoPerms', source)
	end
end)

-- Server Restart in 10 Mins Command
RegisterCommand("svr10", function()
	if IsPlayerAceAllowed(source, "fax.cmds") then
		TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n SERVER RESTART IN 10 MINUTES \n Please Finish Your Current RP Scenario \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
	else
		TriggerClientEvent('Restart:NoPerms', source)
	end
end)

-- Server Restart Now Command
RegisterCommand("svrnow", function()
	if IsPlayerAceAllowed(source, "fax.cmds") then
		TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n SERVER RESTART IS IN PROGRESS \n Please Rejoin the server  \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
		SetGameType("SERVER CURRENTLY RESTARTING")
			AddEventHandler("playerConnecting", function()
				DropPlayer(source, 'The Server is restarting, Rejoin in a minute.')
			end)
	else
		TriggerClientEvent('Restart:NoPerms', source)
	end
end)

-- Server Restart Start Timer
RegisterCommand("svrstart", function()
	if IsPlayerAceAllowed(source, "fax.cmds") then
		TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n SERVER RESTART IN 10 MINUTES \n Please Finish Your Current RP Scenario \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
		Wait(300000)
		TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n SERVER RESTART IN 5 MINUTES \n Please Finish Your Current RP Scenario \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
		SetGameType("Server Restarting Soon")
		Wait(300000)
		TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n SERVER RESTART IS IN PROGRESS \n Please Rejoin the server  \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
		SetGameType("SERVER CURRENTLY RESTARTING")
	else
		TriggerClientEvent('Restart:NoPerms', source)
	end
end)

-- Command for Peace Time on
RegisterCommand("pton", function()
	if IsPlayerAceAllowed(source, "fax.cmds") then
		TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n PEACE TIME IS NOW IN EFFECT \n This Means No Priority Calls.  \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
		SetGameType("Peace Time In Effect")
	else
		TriggerClientEvent('Restart:NoPerms', source)
	end
end)

-- Command for Peace Time on
RegisterCommand("ptoff", function()
	if IsPlayerAceAllowed(source, "fax.cmds") then
		TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n PEACE TIME IS NO LONGER IN EFFECT \n Resume Normal RP.  \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
			SetGameType("Freeroam")
	else
		TriggerClientEvent('Restart:NoPerms', source)
	end
end)

end)

-- Announcement Command
AddEventHandler('chatMessage', function(source, name, msg)
	sm = stringsplit(msg, " ");
	if sm[1] == "/a" then
		if IsPlayerAceAllowed(source, "fax.cmds") then
        CancelEvent()
				TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n ADMINISTRATION ANNOUNCEMENT \n " .. string.sub(msg,3) .. " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
		else
			TriggerClientEvent('AOP:NoPerms', source)
		end
  end
end)

-- Function for Announcement Command
function stringsplit(inputstr, sep)
    if sep == nil then
        sep = "%s"
    end
    local t={} ; i=1
    for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
        t[i] = str
        i = i + 1
    end
    return t
end

client.lua for Restart Script

----------------------------------------
-- Server Notification, Made by FAXES --
----------------------------------------
RegisterNetEvent('RestartList')
AddEventHandler('RestartList', function()
	TriggerEvent("chatMessage", "Restart", {255, 0, 0}, "^3 /svr 5 [Sets 5 mins], /svr 10 [Sets 10 mins], /svr now [Restart Now], /a [Send an admin announcement], /pton [Turn on peacetime], /ptoff [Turn off peacetime].")
	end)

RegisterNetEvent('Restart:NoPerms')
AddEventHandler('Restart:NoPerms', function()
	TriggerEvent("chatMessage", "Restart Script", {255, 0, 0}, "Insignificant Permissions to run command.")
	end)
-- Made by FAXES

client.lua for AOP Script

----------------------------------
-- Area of Patrol, Made by FAXES--
----------------------------------
AddEventHandler('playerSpawned', function()
    TriggerServerEvent('AOP:Sync')
end)

-- No longer in use....
RegisterNetEvent('AOP:List')
AddEventHandler('AOP:List', function()
	TriggerEvent("chatMessage", "AOP Script", {255, 0, 0}, "Blaine County [/aopbc], State Wide [/aopstate], Los Santos [/aopls], Vinewood [/aopvw], Mirror Park [/aopmp] Pillbox Hill / Downtown [aopdt], Davis [/aopdavis], Del Perro [/aopdp], Rockford Hills [/aoprh], Sandy Shores [/aopsandy], Harmony [/aopharm], GrapeSeed [/aopgrape], Paleto Bay [/aoppb], ^4Peace Time On [/pton], Peace Time Off [/ptoff], ^3RP Area Vote [/aopvote]")
end)

AddEventHandler('chatMessage', function(source, name, msg)
    RegisterNetEvent('AOP:NoPerms')
    AddEventHandler('AOP:NoPerms', function()
        TriggerEvent("chatMessage", "AOP Script", {255, 0, 0}, "Insignificant Permissions to run command.")
    end)
        
    RegisterNetEvent('AOP:NoVote')
    AddEventHandler('AOP:NoVote', function()
        TriggerEvent("chatMessage", "AOP Script", {255, 0, 0}, "AOP Vote Is Currently Not Active.")
    end)
end)

FaxCurAOP = "None"
FaxCurAOP2 = "Set"

RegisterNetEvent('AOP:SendAOP')
AddEventHandler('AOP:SendAOP', function(newCurAOP, newCurAOP2)
    FaxCurAOP = newCurAOP
	FaxCurAOP2 = newCurAOP2
end)
    
local year, month, day, hour, minute, second = GetLocalTime()

Citizen.CreateThread(function()
    while true do
    year, month, day, hour, minute, second = GetLocalTime()
        Citizen.Wait(1)
		DrawText2(0.660, 1.458, 1.0,1.0,0.45, "~p~Time: ~w~" .. hour .. ":" .. minute .. " ~p~|  ~w~Current ~r~AOP: ~w~" .. FaxCurAOP .. " " .. FaxCurAOP2, 255, 255, 255, 255)
	end
end)

function DrawText2(x,y ,width,height,scale, text, r,g,b,a)
    SetTextFont(4)
    SetTextProportional(0)
    SetTextScale(scale, scale)
    SetTextColour(r, g, b, a)
    SetTextDropShadow(0, 0, 0, 0,255)
    SetTextEdge(2, 0, 0, 0, 255)
    SetTextDropShadow()
    SetTextOutline()
    SetTextEntry("STRING")
    AddTextComponentString(text)
    DrawText(x - width/2, y - height/2 + 0.005)
end

server.lua for AOP Script

----------------------------------
-- Area of Patrol, Made by FAXES--
----------------------------------

--- CONFIG AREA ---
vote = false				-- Enables the vote command for AOP
peacetime = true		-- Enables the peacetime commands for AOP

--- CODE SPACE DON'T TOUCH ---

FaxCurAOP = "none"
FaxCurAOP2 = "Set"
Faxvotestatus = false

AddEventHandler('onResourceStart', function(resource)
	Citizen.Wait(15000)
	SetMapName("RP : Not Set")
	CancelEvent()
end)

AddEventHandler('chatMessage', function(source, name, msg)
	local args = stringsplit(msg, " ")
	if args[1] == "/aop" then
		if IsPlayerAceAllowed(source, "fax.cmds") then
			if tablelength(args) > 2 then
			CancelEvent()
			FaxCurAOP = args[2]
			FaxCurAOP2 = args[3]
			TriggerEvent('AOP:Sync')
			TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n RP AREA IS NOW : " .. FaxCurAOP .. " " .. FaxCurAOP2 .. " \n Please Finish Your Current RP and Move. \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
			SetMapName("RP : " .. FaxCurAOP .. " " .. FaxCurAOP2)
			else
				TriggerClientEvent("chatMessage", source, "Invalid Input, Use 2 Words (Eg; Sandy Shores)")
			end
		else
			TriggerClientEvent('AOP:NoPerms', source)
		end
	end
end)


RegisterServerEvent('AOP:Sync')
AddEventHandler('AOP:Sync', function()
	TriggerClientEvent('AOP:SendAOP', -1, FaxCurAOP, FaxCurAOP2)
end)


AddEventHandler('chatMessage', function(source, playerName, message)
	-- AOP Command for Peace Time on
	RegisterCommand("pton", function()
		if peacetime == true then
			if IsPlayerAceAllowed(source, "fax.cmds") then
				TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n PEACE TIME IS NOW IN EFFECT \n This Means No Priority Calls.  \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
				SetGameType("Peace Time In Effect")
			else
				TriggerClientEvent('AOP:NoPerms', source)
			end
		end
  	end)
	-- AOP Command for Peace Time off
	  RegisterCommand("ptoff", function()
		if peacetime == true then
			if IsPlayerAceAllowed(source, "fax.cmds") then
				TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n PEACE TIME IS NO LONGER IN EFFECT \n Resume Normal RP.  \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
				SetGameType("Freeroam")
			else
				TriggerClientEvent('AOP:NoPerms', source)
			end
		end
  	end)
	-- AOP Command for Vote
	RegisterCommand("aopvote", function()
		if vote == true then
			if IsPlayerAceAllowed(source, "fax.cmds") then
				Faxvotestatus = true
				TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n RP AREA VOTE \n Use /vote. Vote Lasts 3 Minutes.  \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
				Wait(120000)
				TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n RP AREA VOTE \n Use /vote. 1 Minute Remaining.  \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
				Wait(60000)
				TriggerClientEvent("chatMessage", -1, " \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” \n RP AREA VOTE \n Has Ended. Please Wait For Change.  \n β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”", {239, 0, 0})
				Faxvotestatus = false
			else
				TriggerClientEvent('AOP:NoPerms', source)
			end
		end
	end)
end)

AddEventHandler('chatMessage', function(source, name, msg)
	-- Vote Types
	sm = stringsplit(msg, " ");
	if sm[1] == "/vote" then
		if Faxvotestatus == true then
		CancelEvent()
		TriggerClientEvent('chatMessage', -1, "^5" .. name .. " ^4Has Voted For: ^7" .. string.sub(msg,6))
		else
			TriggerClientEvent('AOP:NoVote', source)
		end
	end
end)

function stringsplit(inputstr, sep)
    if sep == nil then
        sep = "%s"
    end
    local t={} ; i=1
    for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
        t[i] = str
        i = i + 1
    end
    return t
end

function tablelength(T)
  local count = 0
  for _ in pairs(T) do count = count + 1 end
  return count
end
1 Like

The script is using the ace fax.cmds throughout the script. Seeming my AOP and Restart script use different ace perms you will need to change the fax.cmds to owner

2 Likes

I cant get the permissions to work
This is what i have in the server.cfg

add_ace group.admin fax allow
add_ace group.moderator fax allow
start areapatrol

my groups are set up because the permissions work with the menu/trainer i have

3 Likes

try adding that to the permissions.cfg of vmenu if you havent already. I dont think Vmenu even looks in server.cfg so thats probably why.

2 Likes

Have you added yourself to admin, as it looks like you are just telling the server to allow the groups admin and moderator.

2 Likes

For those of you having perm probs make sure your server.cfg has faxes allow not fax allow as per the wiki - otherwise it won’t work.

5 Likes

@FAXES version 1.7 has a mistake: if IsPlayerAceAllowed(source, "faxes.aopcmds") then

that’s why perms aren’t working.

2 Likes

Thanks I’ll push it today

3 Likes