08.11.2016, 14:21
PHP код:
COMMAND:admins(playerid,params[])
{
new count = 0;
new string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] > 0)
{
if(PlayerInfo[i][pAdmin] == 1)
{
AdminRank = "Moderator";
}
else if(PlayerInfo[i][pAdmin] == 2)
{
AdminRank = "General Administrator";
}
else if(PlayerInfo[i][pAdmin] == 3)
{
AdminRank = "Senior Administrator";
}
else if(PlayerInfo[i][pAdmin] == 4)
{
AdminRank = "Server Owner";
}
new Name[MAX_PLAYER_NAME];
GetPlayerName(i,Name,sizeof(Name));
format(string, sizeof(string), "%sLevel: %d | Name: %s (ID:%i) | Rank: %s ", string,PlayerInfo[i][pAdmin], Name,i,AdminRank);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "{00FF00}__|ONLINE ADMINS|__", string, "Close", "");
count++;
}
}
}
if(count == 0)
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "{00FF00}__|ONLINE ADMINS|__", "Theres no admins online.", "Close", "");
return 1;
}