24.05.2013, 16:37
Alright so i've just started this gamemode from scratch and such, and i'm working on the admin system currently. So i've just done the /makeadmin command and whenever you use it in game "level" returns and empty value and doesn't set the admin level.
The code is using zcmd and SSCANF2.
The file saving is y_ini.
The code:
The code is using zcmd and SSCANF2.
The file saving is y_ini.
The code:
pawn Код:
CMD:makeadmin(playerid,params[])
{
new id,level;
if(PlayerInfo[playerid][pAdmin] > 5)
{
if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /makeadmin [ID] [Adminlevel]");
{
if(level > 100000) return SendClientMessage(playerid, ORANGE, "Invalid Level. Valid levels are 1,2,3,4,1336,1337,100000");
else
{
PlayerInfo[id][pAdmin] = level;
format(cmdstr, sizeof(cmdstr), "You've been promoted to a level %d Administrator");
SendClientMessage(id, ORANGE, cmdstr);
return 1;
}
}
}
else
{
SendClientMessage(playerid, RED, "You're not authorized to give admin levels sir!");
return 1;
}
}

