16.06.2013, 12:35
Hey Guys I Have Made A Admin System And I Added [padmin] But Any One Can Still Make There Self Admin Could You Help So People Can't Join My Game And Make There Self Admin. Here Is The Code-
Код:
if(strcmp(cmd, "/makeadmin", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_RED, "USAGE: /makeadmin [playerid/PartOfName] [Admin Rank]"); SendClientMessage(playerid, COLOR_YELLOW, "(0) Remove Admin Status"); SendClientMessage(playerid, COLOR_YELLOW, "(1) 7"); SendClientMessage(playerid, COLOR_YELLOW, "(2) 6"); SendClientMessage(playerid, COLOR_YELLOW, "(3) 6"); SendClientMessage(playerid, COLOR_YELLOW, "(4) 5"); SendClientMessage(playerid, COLOR_YELLOW, "(1337) 4"); SendClientMessage(playerid, COLOR_YELLOW, "(1338) 3"); SendClientMessage(playerid, COLOR_YELLOW, "(1339) s mager"); SendClientMessage(playerid, COLOR_YELLOW, "(99999) Main admin"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if(PlayerInfo[playerid][pAdmin] >= 99999 || strcmp(sendername, "Jess_Milward", true) == 0) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pAdmin] = level; printf("{AA3333}AdmCmd{FFFF00}: %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, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } } } else { SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");