01.09.2013, 10:03
pawn Код:
CMD:setlevel(playerid, params[])
{
new targetid;
new level;
if(sscanf(params, "ui", targetid, level))return SendClientMessage(playerid, -1, "[USAGE]: /setlevel {FF0000}[PlayerID] [Level]");
if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, -1, "[ERROR]: {FFFFFF}This player is {FF0000}NOT {FFFFFF}connected!");
if(level < 0 || level > 10)return SendClientMessage(playerid, -1, "[ERROR]: Invalid Admin Level (0-10)!"); //Change "10" to your MAX. admin level.
pInfo[targetid][Adminlevel] = level;
new INI:file = INI_Open(Path(playerid));
INI_SetTag(file, "Player's Data");
INI_WriteInt(file, "AdminLevel", pInfo[targetid][Adminlevel]);
return 1;
}