SA-MP Forums Archive
How i can make? - 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: How i can make? (/showthread.php?tid=169968)



How i can make? - DarkPower - 21.08.2010

How i can check if 4+ players in range of point example : 10.0 ?


Re: How i can make? - Claude - 21.08.2010

pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);

for(new i = 0; i < MAX_PLAYERS; i++)
{
    new play_count = 0, bool:maxplayers;
    maxplayers = false;
    if(play_count <= 4) continue;
    {
        if(IsPlayerInRangeOfPoint(i, 10, x, y, z))
        {
            play_count++;
        }
    }
    if(play_count > 4)
    {
        maxplayers = true;
        break;
    }
}
Max loop for 4 persons, if you want to make it that there should be 4 at least, change <= to >= and > to <