Question about a loop - 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: Question about a loop (
/showthread.php?tid=525255)
Question about a loop -
K9IsGodly - 11.07.2014
I was wondering if you needed to substitute 'playerid' with "i" in this particular case for every use:
PHP код:
for(new i = 0; i != MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[playerid][pSongPlaying] == 1)
{
Stop*******VideoForPlayer(playerid); // so this becomes Stop*******VideoForPlayer(i); or does it stay how it is?
PlayerInfo[playerid][pSongPlaying] = 0;
Play*******VideoForPlayer(i,ylink);
PlayerInfo[playerid][aSongPlaying] = 1;
}
}
}
Re: Question about a loop -
anou1 - 11.07.2014
Hi,
Yes you have to use "i" instead of "playerid".