SA-MP Forums Archive
Is there any callback for gang zones? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Is there any callback for gang zones? (/showthread.php?tid=331212)



Is there any callback for gang zones? - Gryphus One - 04.04.2012

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?


Re: Is there any callback for gang zones? - ViniBorn - 04.04.2012

I think no other way


Re: Is there any callback for gang zones? - T0pAz - 04.04.2012

You can use this library and manipulate it to your needs. I don't think there are any easier way of doing that.


Respuesta: Is there any callback for gang zones? - Gryphus One - 04.04.2012

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.