SA-MP Forums Archive
Command not working? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command not working? (/showthread.php?tid=591996)



Command not working? - kalanerik99 - 19.10.2015

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;




Re: Command not working? - Sellize - 19.10.2015

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;




Re: Command not working? - kalanerik99 - 19.10.2015

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


Re: Command not working? - kalanerik99 - 19.10.2015

OOOh I see shit How could I missed that