[Release] Area of Play / Patrol (Textdraw/Server Sync)

This is the Area of Play / Patrol script, which I made for the YDDY:RP community after seeing @FAXES AOP script. :mascot:

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]

:face_with_raised_eyebrow: 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”.

Screenshot:

Text position:

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).

Feel free to change this stuff. :metal:

Download:
areaofplay.zip (1.4 KB)

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 :mascot: for it to run out of box.

10 Likes

Looks good. Nice job

1 Like

4d708db267b1280c2f75d40d666ccc7ad348c3d3

could you give me this script? I would be very grateful

Player Location Display

1 Like

Here it is…

2 Likes

What would be the coordinates to place it right over the map?
If yo know could you help me thankyou

Are you able to make this whitelist by steam ID? That would be most helpful.

Is there a way to change what font it uses?

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)
   

Something like that.

Change the font your chat resource uses.

How do I get that text under the AOP?

Is there a way I can chance the colour from white to red?

what do i need to put in to make the text red?

also how can i moce the text down like 5inch

Hey, Every time i change the color the AOP At the bottom does not show
Its like it breaks

the draw text doesn’t work for me after i put this text in do you know how do i fix that while keeping the admin whitelisting?

HELP How Can I Remove This whats is the script name please ???

Hey! I’m having a problem. The text in game is nearly transparent and hard to see. I"ve tried everything to change it but nothing fixes it.

Looking forward for your help! :slight_smile:

Do ~r~ before the text in “client” text doc.