SA-MP Forums Archive
foreach problems - 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: foreach problems (/showthread.php?tid=256986)



foreach problems - _Outbreak_ - 23.05.2011

I've replaced for(new i=0; i<SLOTS; i++) with foreach(LCS_Player, i)

Since then it's causing the server to lag hard, and I'm unable to rejoin the server after leaving. It connects to the server but doesn't go further.

I removed Iter_Add(LCS_Player, playerid); and Iter_Remove(LCS_Player, playerid); from OnPlayerConnect and OnPlayerDisconnect and it worked fine.

I'm not sure what I've done wrong.


new Iterator:LCS_Player<SLOTS>;