22.05.2016, 12:51
Код:
if(strcmp(cmd, "/makeadmin", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00E6FF}UTILIZARE:{FFFFFF} /makeadmin [IDJucator/ParteDinNume] [level(1-1338)]"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if (PlayerInfo[playerid][pAdmin] >= 0 || IsPlayerAdmin(playerid)) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[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); ABroadCast(COLOR_YELLOW,string,5); } } } else { SendClientMessage(playerid, COLOR_GRAD1, "{09F7DF}DENIED: {ffffff}No access"); } } return 1; }