21.12.2015, 01:53
Код:
CMD:admins(playerid, params[]) { if (playerVariables[i][pScore] >= 750) { new count = 1, string[828], sendername[MAX_PLAYER_NAME]; for(new i = 0; i < MAX_PLAYERS; i++) { GetPlayerName(i, sendername, sizeof(sendername)); if(IsPlayerConnected(i) && playerVariables[i][pAdminLevel] >= 1 && playerVariables[i][pAdminLevel] < 8) { // If admin level is higher than 1, here it goes... format(string, sizeof(string), "%s%s(%i) - Level: %i\n", string, playerVariables[i][pName] , i, playerVariables[i][pAdminLevel]); count ++; } } if(count != 1) { // Show admins that are presently online, along with their rank ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Administrators", string, "OK", ""); } else { // No admins online - Either this or nothing, either way the user will know admins are offline... ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Admins", "There are no administrators present.", "OK", ""); } } else { SendClientMessage(playerid, COLOR_WHITE, "{E81919}[ERROR] {FFFFFF}You must have at least 750 score to view the admin list."); } return 1; }
