08.07.2012, 15:52
Mine one!
pawn Code:
COMMAND:setlevel(playerid,params[])
{
new id,level;
if(IsPlayerAdmin(playerid))
{
if(sscanf(params,"ud",id,level)) return SendClientMessage(playerid,COLOR_RED,"[USAGE]: /setlevel [playerid/name] [level]");
else
{
if(level > 5) return SendClientMessage(playerid, COLOR_RED,"Only 1-5 levels allowed!");
else
{
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"RCON Administrator promoted %s to administrator!",pName);
SendClientMessageToAll(COLOR_GREEN,string);
new INI:File = INI_Open(Path(id));
INI_WriteInt(File,"Adminlevel",level);
INI_Close(File);
}
}
}
else
{
return 1;
}
return 1;
}