20.02.2010, 22:33
Hey I use this code
I get this warning
On line where is
when I do /admins ingame, I get
|-----------------------------------------|
No admin online at the moment
|-----------------------------------------|
Please HELP it's URGENTLY!!!!!!
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
{
new string[256];
new player[250];
SendClientMessage(playerid, COLOR_FINALSCORE, "|---------------Online Admins---------------|");
new count=0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] <= 6)
{
GetPlayerName(i, player, sizeof(player));
format(string, 256, "Administrators: %s(%d)-%d",player, i, PlayerInfo[playerid][pAdmin]);
SendClientMessage(playerid, COLOR_CYAN, string);
count++;
}
}
}
if(count == 0)
{
SendClientMessage(playerid, COLOR_CYAN, "No admin online at the moment.");
}
SendClientMessage(playerid, COLOR_FINALSCORE, "|--------------------------------------------------|");
return 1;
}
Код:
warning 219: local variable "i" shadows a variable at a preceding level
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
|-----------------------------------------|
No admin online at the moment
|-----------------------------------------|
Please HELP it's URGENTLY!!!!!!