Command not working?
#1

Hello everyone!
I have one problem...
If I am not VIP and I login as admin(RCON) command returns 0
If I wont command to work I have to be vip...
But thats not right...Why this doesn't work
Код:
if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][AdminLevel] < 5) return 0;
PHP код:
CMD:setvip(playerid,params[])
{
new 
level,id;
if(!
IsPlayerAdmin(playerid) || PlayerInfo[playerid][AdminLevel] < 5) return 0;
else
if(!
IsPlayerConnected(id))return SendClientMessage(playerid,COLOR_GREY,"You have entered an incorrect ID");
if(
sscanf(params"ui"idlevel)) return SendClientMessage(playeridCOLOR_RED"USAGE: /setvip [playerid] [level(0-1]");
if(
level || level 1) return SendClientMessage(playeridCOLOR_RED"Level must be between 0 and 1!");
new 
str[512];
PlayerInfo[id][VIP] = level;
dini_IntSet(UserPath(id),"VIP",level);
format(str,sizeof(str),""COL_RED"Admin %s "COL_ORANGE"have has given "COL_RED"VIP "COL_ORANGE"status to "COL_LIGHTBLUE"%s",PlayerName(playerid),PlayerName(id));
SendClientMessageToAll(COLOR_LIGHTBLUE,str);
return 
1;

Reply
#2

PHP код:
CMD:setvip(playerid,params[])
{
    new 
level ,id;
    if(!
IsPlayerAdmin(playerid) && PlayerInfo[playerid][AdminLevel] < 5) return 0;
    
    if(
sscanf(params"ui"idlevel)) return SendClientMessage(playeridCOLOR_RED"USAGE: /setvip [playerid] [level(0-1]");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREY,"You have entered an incorrect ID");
    if(
level || level 1) return SendClientMessage(playeridCOLOR_RED"Level must be between 0 and 1!");
    
    new 
str[128];
    
PlayerInfo[id][VIP] = level;
    
dini_IntSet(UserPath(id),"VIP",level);
    
format(str,sizeof(str),""COL_RED"Admin %s "COL_ORANGE"have has given "COL_RED"VIP "COL_ORANGE"status to "COL_LIGHTBLUE"%s",PlayerName(playerid),PlayerName(id));
    
SendClientMessageToAll(COLOR_LIGHTBLUE,str);
    return 
1;

Reply
#3

Noooo see
I want that even ifI am not VIP and I am ADMIN command will work...
Reply
#4

OOOh I see shit How could I missed that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)