Detecting amount of players in a gangzone. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Detecting amount of players in a gangzone. (
/showthread.php?tid=274673)
Detecting amount of players in a gangzone. -
Saurik - 06.08.2011
So basically i don't want more than 1 person to enter a zone. How can i calculate the amount of players enter a zone, and if there are more than 1 then just not let them take over zone ?
Re: Detecting amount of players in a gangzone. -
Backwardsman97 - 06.08.2011
Do a for loop through the players and check each one if they are in the zone. Each time a player is found in the zone, add to a variable. Then, check if that variable is greater than one.
Re: Detecting amount of players in a gangzone. -
Kyle_Olsen - 06.08.2011
Try using IsPlayerInRangeOfPoint in a loop with all players and such... That's what I'd do at least.