Easy question about loops - 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: Easy question about loops (
/showthread.php?tid=149894)
Easy question about loops -
russo666 - 23.05.2010
Day by day i'm getin worst in script... I'm forgetin everything. (I have a problem, so don't 'blame' me).
When do i have to use loops? This question arose because someone said that using the playerid on OnPlayerUpdate would be for all players. The first thing that i said was that is not true because that was going to work just for id 0, but i go into the game and tested it and it worked. O:
Now i'm confused about loops.
Can someone help me? Thanks.
Re: Easy question about loops -
Nero_3D - 24.05.2010
ah loop is nothing else as a code which repeats itsself x times with an increasing / decreasing variable
And about the publics, the sa-mp server call publics when a event happens, so if the player spawn OnPlayerSpawn is called, its correct that the variable playerid only contains the playerid of the player spawned and all people spawn sometime so OnPlayerSpawn gets called indireclty for all players