How do I make a loop that skips a player? - 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: How do I make a loop that skips a player? (
/showthread.php?tid=163310)
How do I make a loop that skips a player? -
VictorMartinez - 26.07.2010
How do I make a loop that skips a a selected player? I'm trying to make a GetClosestPlayer function but when it loops it always says the player is closest to the player. Obviously, I need to skip checking that player.
Re: How do I make a loop that skips a player? -
mastasquizy - 27.07.2010
Lemme see some code!
Re: How do I make a loop that skips a player? -
bigcomfycouch - 27.07.2010
pawn Код:
foreach(Player, i)
{
if(i == playerid) continue;
}
Re: How do I make a loop that skips a player? -
cessil - 27.07.2010
for(new i=0;i<=MAX_PLAYERS;i++)
{
if(i != playerid)
{
//stuff here
}
}
Re: How do I make a loop that skips a player? -
VictorMartinez - 27.07.2010
thanks man