27.01.2016, 22:04
Код:
CMD:makeadmin(playerid, params[]) { new id, string[128], level, code[5]; generateCode(code, 5); if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, COLOR_BLUE, "You don't have acces to that command."); if(sscanf(params, "dd", id, level)) return SendClientMessage(playerid, COLOR_RED, "SERVER: /makeadmin [ID] [LEVEL]"); format(string, sizeof(string), "%s promoted you to level %i.\nSecurity Code: %s", PlayerName(playerid), level, code); ShowPlayerDialog(id,DIALOG_ADMINBOX,DIALOG_STYLE_MSGBOX, "You are an admin", string, "Ok", ""); format(string, sizeof(string), "You promoted %s to level %i.", PlayerName(id), level); SendClientMessage(playerid, COLOR_BLUE, string); PlayerInfo[id][pAdmin] = level; format(AdminKod[playerid], 6, code); // Stores the code into the string return 1; }