Cikle - 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: Cikle (
/showthread.php?tid=609660)
Cikle -
ScIrUsna - 15.06.2016
Hi,
How to start cikle again? now i do
Code:
for(new i = 0; i < MAX_PLAYERS; i ++)
{
}
i want to start not from 0 but from max_players and then -- when it reach 0
Re: Cikle -
Sc0tt - 15.06.2016
PHP Code:
for(new i = MAX_PLAYERS; i >= 0 ; i--)
{
}
Like that ?
Re: Cikle -
Ult1mate - 15.06.2016
Try this:
Code:
for(new i = MAX_PLAYERS; i > -1; i--)
{
if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
/* Other codes */
}