25.05.2013, 19:18
Try this:
Meanwhile. Why are you writing an entire new file when you set the players admin level? i'm not too good with Dini. i've forgotten most of it. Tell me, when you use the command in game, does it actually work. Have you tried any admin commands you've made?
pawn Код:
//try it like this
CMD:makeadmin(playerid, params[])
{
new targetid;
new level;
new string[200];
if(gPlayerInfo[playerid][pAdminLevel] < gCommands[MAKEADMIN])return SCM(playerid, COLOR_RED, "[ERROR]: You can't use this command!");
if(sscanf(params, "ui", targetid, level))return SCM(playerid, COLOR_GREY, "[USAGE]: /makeadmin [playerid] [level]");
if(!IsPlayerConnected(targetid))return SCM(playerid, COLOR_RED, "[ERROR]: This player is not connected!");
if(level < 0 || level > 10)return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Invalid Admin Level (0-10)!");
gPlayerInfo[targetid][pAdminLevel] = level;
format(string, sizeof(string), "{80FF00}[FMJ NAdmin]: {0000FF}%s(ID:%d) has changed %s(ID:%d)'s Admin Level to %i!", GetName(playerid), playerid, GetName(targetid), targetid, level);
SCMToAll(COLOR_BLUE, string);
gPlayerLogged[playerid] = 0;
return 1;
}

