13.05.2015, 04:34
pawn Код:
COMMAND:admins(playerid, params[])
{
SendAdminText(playerid, "/admins", params);
if(!APlayerData[playerid][LoggedIn]) return SendClientMessage(playerid, 0xFF0000FF, "REPORT THIS TO ADMIN");
new count = 0, AdminList[750];
for(new i = 0, j = GetPlayerPoolSize(); i != j; i++)
{
if(!IsPlayerConnected(i)) continue;
if(!APlayerData[i][PlayerLevel]) continue;
new fstr[75], Name[MAX_PLAYER_NAME];
GetPlayerName(i, Name, sizeof(Name));
format(fstr, sizeof(fstr), "%s: %s (id: %i), admin-level: %i", AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]);
strcat(fstr, (IsPlayerAdmin(i)) ? ("(RCON admin)\n") : ("\n"));
strcat(AdminList, fstr);
count++;
if(count >= 10) break;
}
if(!count) return SendClientMessage(playerid, 0xFF0000FF, "No admin online");
ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Online admins:", AdminList, "OK", "Cancel");
return 1;
}
Example: If your maximum admin level is 10, AdminLevelName should be 11. (Unless you want to take 1 from the variable in the code - eg. AdminLevelName[APlayerData[i][PlayerLevel] - 1])