28.01.2011, 21:20
can anyone show me how to make a loop which go trough all players expect admins?
for(new i = 0; i < GetMaxPlayers(); i ++)
{
if(IsPlayerAdmin(i)) continue; // skip the cycle if the player is an admin
// ... your code
}
for(new i = 0; i < 100; i++)
SendClientMessageToAll(White," ");
if(PlayerInfo[playerid][pAdminLevel] >=1)
for(new d,g=GetMaxPlayers(); d < g; d++)
if(IsPlayerConnected(d) && !PlayerInfo[d][pAdminLevel])
for(new i; i < 100; i++)
SendClientMessage(d,White," ");
E:\GTA San Andreas\DM\gamemodes\xir.pwn(1522) : error 028: invalid subscript (not an array or too many subscripts): "GetMaxPlayers"
E:\GTA San Andreas\DM\gamemodes\xir.pwn(1522) : warning 215: expression has no effect
E:\GTA San Andreas\DM\gamemodes\xir.pwn(1522) : error 001: expected token: ")", but found ";"
E:\GTA San Andreas\DM\gamemodes\xir.pwn(1522) : error 036: empty statement
E:\GTA San Andreas\DM\gamemodes\xir.pwn(1522) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
for(new d,g=GetMaxPlayers{]; d < g; d++)