Zone script


#1

Any possible way anyone know of making a section on the map or an area a safe zone, players do not have pvp enabled or no weapons able to be used in a certain section? Anyone?


#2

if player is within range of a set of coords, disabled the friendly fire and set whatever else you want.


#3

As Briglair said, simply messure the distance to the center point. You could also use AABB algorithm to detect a player inside a box.


#4

You guys are awesome now just to find out how I can do this now that I know it can be done


#5

Some of these natives should help.

https://runtime.fivem.net/doc/reference.html#_0x3FEF770D40960D5A - for getting the player’s location.
https://runtime.fivem.net/doc/reference.html#_0xF808475FA571D823 - for disabling pvp
https://runtime.fivem.net/doc/reference.html#_0xF25DF915FA38C5F3 - for removing the player’s weapons

You could also toggle god mode on a player if they’re in your designated area, as players would still be able to shoot into the area from outside of it.


#6

hi. is there already a script with this function? if yes would you share it ?


#7

Try this maybe.

Otherwise here’s the point in poly code.
https://wrf.ecse.rpi.edu//Research/Short_Notes/pnpoly.html