24.05.2016, 20:51
I have this makeadmin script, and I want to make it so admins get a message when someone makes somebody an admin. I am stuck on:
makeadmin:
Код:
stock SendAdminMessage(playerid) { for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerInfo[pAdmin] >= 4) continue;
Код:
CMD:makeadmin(playerid, params[]) { if (!Player[playerid][pAdmin] && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{09F7DF}DENIED: {ffffff}No access"); new para1, level; if (sscanf(params, "ri", para1, level)) return SendClientMessage(playerid, -1, "{00E6FF}UTILIZARE:{FFFFFF} /makeadmin [IDJucator/ParteDinNume] [level(1-1338)]"); if (para1 == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Invalid player"); if (!(1 <= level <= 1338)) return SendClientMessage(playerid, -1, "Invalid level. It must be between 1 and 1338"); new giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], string[144]; GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); Player[para1][pAdmin] = level; printf("AdmWarning: %s has promoted %s to a level %d admin.", sendername, giveplayer, level); format(string, sizeof(string), " You have been promoted to a level %d admin by %s", level, sendername); SendClientMessage(para1, COLOR_LIGHTBLUE, string); format(string, 128, "{D11515}[AdmWarning]: {FF9203}%s {FFFFFF}has set {FF9203}%s {FFFFFF}to a level {FF9203}%d {FFFFFF}admin.", sendername, giveplayer, level); SendAdminMessage(-1, string); return 1; }