28.03.2016, 18:10
pawn Code:
CMD:setlevel(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, GREY, "You are not an RCON admin!");
new
pLevel,
pID
;
if(sscanf(params, "dd", pID, pLevel)) return SendClientMessage(playerid, GREY, "USAGE: /setlevel <ID> <Level>");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, GREY, "You have entered an incorrect ID");
new
pName[MAX_PLAYER_NAME],
file[56]
;
GetPlayerName(pID, pName, sizeof(pName));
format(file, sizeof(file), "gAdmin/Users/%s.txt", pName);
PInfo[pID][Level] = pLevel;
dini_IntSet(file, "Level", pLevel);
format(file, sizeof(file), "You have set %s's level to %d", pName, pLevel);
SendClientMessage(playerid, LIGHTBLUE, file);
return 1;
}