if(strcmp(cmd, "/removeadmin", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: /removeadmin [playerid]"); return 1; } new para1; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(PlayerInfo[playerid][pAdminLevel] >= 10) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[giveplayerid][pAdminLevel] = 0; format(string, sizeof(string), "AdmCmd: %s had his/her Admin Level removed by %s.", giveplayer, sendername); SendClientMessageToAll(COLOR_RED, string); } } } else { SendClientMessage(playerid, COLOR_RED, " Identification Error - You need admin level 10 to do this."); return 1; } } return 1; }
dcmd_makeadmin(playerid,params[]) { new level, tmp[256], string[128],string2[128]; level = strval(tmp); new pName[24], str[128]; GetPlayerName(playerid, pName, sizeof(pName)); format(str, sizeof(str),PlayerFile,pName); new player, name[24], bu[128]; if(!(dini_Int(str, "AdminLevel") >= 1)) { SendClientMessage(playerid, COLOR_RED, "Admins Only!"); return 1; } if(sscanf(params,"ui",player,level)) { SendClientMessage(playerid, COLOR_4, "/makeadmin [PlayerID] [Level]"); return 1; } if(!IsPlayerConnected(player)) { SendClientMessage(playerid, COLOR_RED, "Invalid Player ID."); return 1; } else { GetPlayerName(player, name, sizeof(name)); format(bu, sizeof(bu),PlayerFile,name); dini_IntSet(bu, "AdminLevel", level); format(string,sizeof(string),"You promited %s to level %d admin!",name,level); format(string2,sizeof(string2),"Admin %s has prometed you to level %d admin!",pName,level); SendClientMessage(playerid,COLOR_RED,string); SendClientMessage(player,COLOR_RED,string2); } return 1; }
Originally Posted by [69
StreetGT ]
if you have /makeadmin command is only make /makeadmin ID 0 |
if(strcmp(cmd, "/makevip", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: /makevip [playerid]"); return 1; } new para1; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(PlayerInfo[playerid][pAdminLevel] >= 10) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[giveplayerid][pVIPMember] = 1; format(string, sizeof(string), "AdmCmd: %s has been made a VIP Member by %s.", giveplayer, sendername); SendClientMessageToAll(COLOR_RED, string); } } } else { SendClientMessage(playerid, COLOR_RED, " Identification Error - You need admin level 10 to do this."); return 1; } } return 1; }