SA-MP Forums Archive
About cikles. - 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: About cikles. (/showthread.php?tid=369361)



About cikles. - budelis - 16.08.2012

Hi. I want to do cikle for players and just for CONNECTED i want to do it myself and i want to ask well?

new Players;

Код:
OnPlayerConnect:

Players ++

OnPlayerDisconnect

Players --;
My cikle:

for(new i = 0; i < Players; i++)
{

Does it will be just for connect players?


Re: About cikles. - Sandiel - 16.08.2012

I don't exactly follow here...by cikel, do you mean cycle, if so, it is called a loop.
And what do you wanna do with it?


Re: About cikles. - [XST]O_x - 16.08.2012

No. You can just do this instead:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
    }
}