10.02.2011, 17:21
This script is bugged when it is 2 or more admins online.. How to fix it.. i guess i made it on a stupid way but :S
Can someone make it working? xD
Can someone make it working? xD
pawn Код:
dcmd_admins(playerid, params[])
{
#pragma unused params
SendClientMessage(playerid, 0xDEEE20FF, "Online Admins:");
new names[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, names, sizeof(names));
for(new i = 0; i < MAX_PLAYERS; i++)
if(PlayerData[i][AdminLevel] == 5 && IsPlayerConnected(i) && IsAppearingOnList[i] == 1)
{
format(string, sizeof(string), "%s(%d) - Admin Level 5",names ,i);
SendClientMessage(playerid, 0x0054A8AA, string);
return 1;
}
else if(PlayerData[i][AdminLevel] == 4 && IsPlayerConnected(i) && IsAppearingOnList[i] == 1)
{
format(string, sizeof(string), "%s(%d) - Admin Level 4",names ,i);
SendClientMessage(playerid, 0x0054A8AA, string);
return 1;
}
else if(PlayerData[i][AdminLevel] == 3 && IsPlayerConnected(i) && IsAppearingOnList[i] == 1)
{
format(string, sizeof(string), "%s(%d) - Admin Level 3",names ,i);
SendClientMessage(playerid, 0x0054A8AA, string);
return 1;
}
else if(PlayerData[i][AdminLevel] == 2 && IsPlayerConnected(i) && IsAppearingOnList[i] == 1)
{
format(string, sizeof(string), "%s(%d) - Admin Level 2",names ,i);
SendClientMessage(playerid, 0x0054A8AA, string);
return 1;
}
else if(PlayerData[i][AdminLevel] == 1 && IsPlayerConnected(i) && IsAppearingOnList[i] == 1)
{
format(string, sizeof(string), "%s(%d) - Admin Level 1",names ,i);
SendClientMessage(playerid, 0x0054A8AA, string);
return 1;
}
return SendClientMessage(playerid, 0x0054A8AA, "[BOT] Anti-Cheat");
}