Setlevel
#1

Hey, no matter what level i set to myself i still can use /ban etc..

PHP код:
CMD:setlevel(playeridparams[])
{
    new 
alevelIDname[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"IDalevel)) 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(playeridnamesizeof(name));
    
GetPlayerName(IDpnamesizeof(pname));
    
format(strsizeof(str), "{FF0000}[INFO]: {FFFFFF}Administrator {FF0000}%s {FFFFFF}has setted your Admin Level to {FF0000}%i."namealevel);
    
SendClientMessage(ID, -1str);
    
format(strsizeof(str), "{FF0000}[INFO]: {FFFFFF}You made player {FF0000}%s {FFFFFF}Admin Level {FF0000}%i."pnamealevel);
    
SendClientMessage(playerid, -1str);
    
pInfo[ID][Adminlevel] = alevel;
    return 
1;

Reply
#2

You have to add an exception to your admin commands for regular players.

Example:
pawn Код:
if(pInfo[playerid][Adminlevel] <= 0) return 0;
Reply
#3

ah ok, where to add it btw? ban command? etc? or setlevel?
Reply
#4

try this
PHP код:
CMD:setlevel(playeridparams[])
{
    new 
alevelIDname[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"IDalevel)) 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(playeridnamesizeof(name));
    
GetPlayerName(IDpnamesizeof(pname));
    
format(strsizeof(str), "{FF0000}[INFO]: {FFFFFF}Administrator {FF0000}%s {FFFFFF}has setted your Admin Level to {FF0000}%i."namealevel);
    
SendClientMessage(ID, -1str);
    
format(strsizeof(str), "{FF0000}[INFO]: {FFFFFF}You made player {FF0000}%s {FFFFFF}Admin Level {FF0000}%i."pnamealevel);
    
SendClientMessage(playerid, -1str);
    
pInfo[ID][Adminlevel] = alevel;
    return 
1;

Reply
#5

Quote:
Originally Posted by Stuun23
Посмотреть сообщение
ah ok, where to add it btw? ban command? etc? or setlevel?
"...your admin commands..." - Plural, each and every single admin command you have. Beware of levels which are required to use a certain command!
Reply
#6

Works but now i can use /ban but not /kick..
Reply
#7

Quote:
Originally Posted by Stuun23
Посмотреть сообщение
Works but now i can use /ban but not /kick..
who is fixed it my way ?
Reply
#8

try this now
PHP код:
CMD:setlevel(playeridparams[])
{
    new 
alevelIDname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME], str[128];
    if(!
IsPlayerAdmin(playerid)) 
    if(
sscanf(params"ui"IDalevel)) 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(playeridnamesizeof(name));
        
GetPlayerName(IDpnamesizeof(pname));
        
format(strsizeof(str), "{FF0000}[INFO]: {FFFFFF}Administrator {FF0000}%s {FFFFFF}has setted your Admin Level to {FF0000}%i."namealevel);
        
SendClientMessage(ID, -1str);
        
format(strsizeof(str), "{FF0000}[INFO]: {FFFFFF}You made player {FF0000}%s {FFFFFF}Admin Level {FF0000}%i."pnamealevel);
        
SendClientMessage(playerid, -1str);
        
pInfo[ID][Adminlevel] = alevel;
    }
    else 
SendClientMessage(playeridCOLOR_RED"You're not rcon administrator.");
    return 
1;

Reply
#9

Post /kick command code
Reply
#10

Not only kick, all the commands exept ban
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)