24.08.2012, 09:27
Hey guys,
I've got this /admins command uh, sometimes it shows who's online and sometimes the server returns "SERVER: Unkown Command" after it gives "====[Online Administrators]====", so I'm going to paste the command here, and please tell me what's wrong?
I guess the problem starts from this line:
I've got this /admins command uh, sometimes it shows who's online and sometimes the server returns "SERVER: Unkown Command" after it gives "====[Online Administrators]====", so I'm going to paste the command here, and please tell me what's wrong?
pawn Код:
CMD:admins(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_RED, "====[Online Administrators]====");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 6)
{
new admtext[64], sendername[MAX_PLAYER_NAME], string[128];
if(PlayerInfo[i][pAdmin] == 5) { admtext = "Owner"; }
else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Head Admin"; }
else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Lead Admin"; }
else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Basic Admin"; }
else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Trial Admin"; }
else { admtext = "Trial Admin"; }
GetPlayerName(i, sendername, sizeof(sendername));
sendername[strfind(sendername,"_")] = ' ';
if(AdminDuty[i] == 0)
{
format(string, 128, "%s: %s (AdminDuty: No)", admtext, sendername);
SendClientMessage(playerid, COLOR_RED, string);
}
else
{
format(string, 128, "%s: %s (AdminDuty: Yes)", admtext, sendername);
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
}
}
}
return 1;
}
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{