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?
if player is within range of a set of coords, disabled the friendly fire and set whatever else you want.
As Briglair said, simply messure the distance to the center point. You could also use AABB algorithm to detect a player inside a box.
You guys are awesome now just to find out how I can do this now that I know it can be done
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.
hi. is there already a script with this function? if yes would you share it ?
Try this maybe.
Otherwise here’s the point in poly code.