About cycles. - 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 cycles. (
/showthread.php?tid=389493)
About cycles. -
budelis - 02.11.2012
Hi,
If i do a cycle throw 500.
Код:
for(new i; i < 500; i++)
{
}
When player spawn, and then other player spawn, and for first player cycle not end all, and then will start new cycle? i have mean maybe new i; use is not safe? maybe will be better to create:
Код:
new Cycle[ MAX_PLAYERS ];
for(Cycle[ playerid ] = 0; Cycle[ playerid ] < 500; Cycle[ playerid ] ++)
?
Re: About cycles. -
MP2 - 02.11.2012
The variable will be 'forgotten' when it is called again. It won't be re-used. It's nothing to worry about.
P.S. It's called a
loop, not a
cycle.