View Full Version : Is there any callback for gang zones?

Gryphus One
04/04/2012, 12:12 AM
Hi, I'm trying to create a gamemode in which Hydras can roam the whole San Andreas map except Las Venturas, which will be a safe zone. I have used GangZoneCreate and GangZoneShowForAll so LV is green and has a yellow border:


What I want to do is the following: when a player enters the yellow border he gets a warning (I might use GameTextForPlayer for that), and if he enters the green zone in a Hydra the vehicle is selfdestructed and the player ejected. So my question is, what's the best way for this? should I create a custom function (like IsPlayerInLV for example) that checks the coordinates of the player and returns 1 or 0, and call that function in OnPlayerUpdate? is there any other way that doesn't imply constantly checking the coordinates of all players several times per second?

04/04/2012, 12:17 AM
I think no other way

04/04/2012, 12:19 AM
You can use this library (http://forum.sa-mp.com/showthread.php?t=27598) and manipulate it to your needs. I don't think there are any easier way of doing that.

Gryphus One
04/04/2012, 02:11 AM
Ok yeah I created my own custom functions that check the coordinates and I'm calling those functions in OnPlayerUpdate, and at the moment seems to be working.