PHP код:
CMD:osetlevel(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new file[256];
new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /osetlevel [name] [level]");
if(isnull(tmp2)) return SendClientMessage(playerid, red, "ERROR: You must give a reason");
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(tmp));
if(!fexist(file)) return SendClientMessage(playerid, red, "ERROR: that account don't even exist!");
dini_Set(file,"level",tmp2);
new year,month,day; getdate(year, month, day); new hour,minute,second; gettime(hour,minute,second);
format(ystring,sizeof(ystring),"You have set %s's level to %s on %d/%d/%d at %d:%d:%d",tmp,tmp2 ,day, month, year, hour, minute, second );
return SendClientMessage(playerid,blue,ystring);
} else return SendClientMessage(playerid,red,"ERROR: Player must be registered to be admin");
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
} else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}