This is the Area of Play / Patrol script, which I made for the YDDY:RP community after seeing @FAXES AOP script.
It allows you to set a custom RP zone and draw it for all players.
Features:
Sync between server & client, so the current AOP is updated upon player’s connection and AOP change.
Instant chat notifications regarding AOP change.
Awesome TextDraw by the radar, so the players will know where the AOP is. (By default it’s set to state and will display “San Andreas”).
Usage:
/aop [Area]
Please note the [Area] should be two words long separated with one space, e.g. “Los Santos”, “San Andreas”, “Sandy Shores”, “Paleto Bay” etc. (You can use it with russian letters too, neat!)
You can also type in additional areas using forward slash instead of space, e.g. “Sandy Shores/Grapeseed”.
As you can see on the screenshot, AOP is being drawn right above @lowheartrate’s Street Label and our watermark. So you probably would want to change that for your server.
In client.lua find 17’th line where it says “DrawText2(0.674, 1.358”,
0.674 is X (horizontal alignment of the text), 1.358 is Y (vertical alignment of the text).
Installation/Requirements:
Place “areaofplay” into your resources folder and add “start areaofplay” to your server.cfg.
It’s a standalone script, you are going to need one snail for it to run out of box.
If you own or develop a server you should learn Lua and how to do this yourself.
It’s pretty easy to do
Server.lua
admins {
'steam:id',
}
function isAdmin(player)
local allowed = false
for i,id in ipairs(admins) do
for x,pid in ipairs(GetPlayerIdentifiers(player)) do
if string.lower(pid) == string.lower(id) then
allowed = true
end
end
end
return allowed
end
Client.lua
AddEventHandler('chatMessage', function(source, name, msg)
local args = stringsplit(msg, " ")
if args[1] == "/aop" and isAdmin true then
if tablelength(args) > 2 then
CancelEvent()
CurrentAOP = args[2]
CurrentAOP2 = args[3]
TriggerEvent('aop:requestSync')
TriggerClientEvent('chatMessage', -1, '^1[!]', {255, 255, 255}, " ^7AOP has been changed to ^1" .. CurrentAOP .. " " .. CurrentAOP2 .. '^7.\n Please finish your current RP and move.')
else
TriggerClientEvent('chatMessage', -1, '', {255, 255, 255}, '^7Incorrect syntax.')
end
end
end)