08.01.2015, 04:52
Hey, no matter what level i set to myself i still can use /ban etc..
PHP код:
CMD:setlevel(playerid, params[])
{
new alevel, ID, name[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME], str[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]: You're not rcon administrator.");
if(sscanf(params, "ui", ID, alevel)) return SendClientMessage(playerid, -1, "{FF0000}USAGE: {FFFFFF}/SetLevel [Player ID] [Level]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {FFFFFF}That player isn't connected.");
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(ID, pname, sizeof(pname));
format(str, sizeof(str), "{FF0000}[INFO]: {FFFFFF}Administrator {FF0000}%s {FFFFFF}has setted your Admin Level to {FF0000}%i.", name, alevel);
SendClientMessage(ID, -1, str);
format(str, sizeof(str), "{FF0000}[INFO]: {FFFFFF}You made player {FF0000}%s {FFFFFF}Admin Level {FF0000}%i.", pname, alevel);
SendClientMessage(playerid, -1, str);
pInfo[ID][Adminlevel] = alevel;
return 1;
}