23.11.2012, 17:15
pawn Код:
if (strcmp(cmdtext, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, "Admins Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pHide] == 0)
{
new admin[20];
if(PlayerInfo[playerid][pAdmin] == 1) { admin = "Test Admin"; }
else if(PlayerInfo[playerid][pAdmin] == 2) { admin = "Moderator"; }
else if(PlayerInfo[playerid][pAdmin] == 3) { admin = "Administrator"; }
else if(PlayerInfo[playerid][pAdmin] == 4) { admin = "Owner"; }
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
if(PlayerInfo[i][aDuty] == 0)
{
format(string, 256, "%s:{FFFF00}%s(ID:%d) {FF0000}Off-Duty",admin, sendername, i);
SendClientMessage(playerid, COLOR_RED, string);
}
else if(PlayerInfo[i][aDuty] == 1)
{
format(string, 256, "%s:{FFFF00}%s(ID:%d) {00FF00}On-Duty",admin, sendername, i);
SendClientMessage(playerid, COLOR_GREEN, string);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "No admins online!");
}
}
}
}
SendClientMessage(playerid, COLOR_GREEN, "______________");
}
return 1;
}