20.10.2011, 10:27
pawn Code:
CMD:setlevel(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,GREY,"You are not an RCON admin!");//if the player is not rcon admin
new level, target;
if(sscanf(params, "ud", target, level)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Usage '/setlevel <playerid/name> <level>'");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid,GREY,"You have entered an incorrect ID"); //if the id is not connected
format(file,sizeof(file),"MyAdmin/Users/%s.txt", pName(target));
PInfo[target][pAdminLevel] = level;
dini_IntSet(file, "Level", level);
new str[90];
format(str,sizeof(str),"You have set %s's level to %d", pName(target), level);
SendClientMessage(playerid,LIGHTBLUE,str);
return 1;
}