CMD:admins(playerid,params[])
{
new string[128],count = 0,level,adminname[MAX_PLAYER_NAME];
level = PlayerInfo[playerid][pAdmin];
GetPlayerName(playerid,adminname,128);
for(new i = 0;i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[playerid][pAdmin] >= 0)
{
switch(PlayerInfo[playerid][pAdmin])
{
case 1: AdmRank = "Trial Moderator";
case 2: AdmRank = "Moderator";
case 3: AdmRank = "Global Moderator";
case 4: AdmRank = "Trial Manager";
case 5: AdmRank = "Header Administrator";
case 6: AdmRank = "Senior Administrator";
case 7: AdmRank = "Junior Administrator";
case 8: AdmRank = "Scripter/Mapper";
case 9: AdmRank = "Co-Owner";
}
if(PlayerInfo[playerid][pAdmin] >= 10)
{
AdmRank = "Server Owner";
}
format(string,sizeof(string),"%s(ID:%d) | Level:%d - %s\n\nTotal Admins Online: %i",adminname,i,level,AdmRank,count);
ShowPlayerDialog(i,523,0,""white"Admins Online:",string,"OK","");
count++;
}
}
else if(count == 0)
{
ShowPlayerDialog(i,524,0,""white"Admins Online",""red"No Admins Online!","OK","");
}
}
return 1;
}
for(new i=0; i<GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i)) continue; // Not connected, continue
if(!pLevel[i]) continue; // Not admin, continue
if(!count) format(string, sizeof(string), "%s", pName[i]); // The first
else format(string, sizeof(string), "\n%s", pName[i]); // Not the first, start with \n
count++;
}
if(!count) return ShowPlayerDialog(.. no admins online ..); // No admins, display the 'no admins' dialog and stop the script there (return)
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Admins Online:", string, "OK", ""); // Script carried on, show list of admins
pawn Код:
|
for(new i=0; i<GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i)) continue; // Not connected, continue
if(!pLevel[i]) continue; // Not admin, continue
if(!count) format(string, sizeof(string), "%s", pName[i]); // The first
else format(string, sizeof(string), "%s\n%s", string, pName[i]); // Not the first, start with \n
count++;
}
if(!count) return ShowPlayerDialog(.. no admins online ..); // No admins, display the 'no admins' dialog and stop the script there (return)
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Admins Online:", string, "OK", ""); // Script carried on, show list of admins