SA-MP Forums Archive
how to detect how many people are in a specific area - 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: how to detect how many people are in a specific area (/showthread.php?tid=606335)



how to detect how many people are in a specific area - Lirbo - 02.05.2016

Let's say if they're in this coords it'd teleport them to somewhere else:

PHP код:
if(IsPlayerInArea(i, -3002.493, -3005.6382404.2922401.122) && F[2]>100 && F[2]<110){
JQCount=JQCount+1;
if(
JQCount 2){/* Script */}
return 
1;} 
but the thing is how can I detect that he's leaving the area. if i'll do it the player will just be able to get out and get in again so it'd increase the count


Re: how to detect how many people are in a specific area - Konstantinos - 02.05.2016

Dynamic areas by streamer plugin. When OnPlayerLeaveDynamicArea is called, decrease by 1 the global variable (assuming it is).