SA-MP Forums Archive
unknown command but still shows. - 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: unknown command but still shows. (/showthread.php?tid=332514)



unknown command but still shows. - oscar7610 - 08.04.2012

if(!strcmp(cmdtext, "/drink", true))
{

ApplyAnimation(playerid,"BAR","dnk_stndM_loop",4.1 ,1,1,1,1,1,1);

}
if(!strcmp(cmdtext, "/pee", true))
{

ApplyAnimation(playerid,"PAULNMAC","Piss_in",4.1,1 ,1,1,1,1,1);

return 1;
// Returning 1 informs the server that the command has been processed.
// OnPlayerCommandText won't be called in other scripts.
}



return 0;
// Returning 0 informs the server that the command hasn't been processed by this script.
// OnPlayerCommandText will be called in other scripts until one returns 1.
// If no scripts return 1, the 'SERVER: Unknown Command' message will be shown.
}


example /me looks down
unknown command (but still shows /me) but it shows unknown command.


Re: unknown command but still shows. - Cjgogo - 08.04.2012

First of all,use [/pawn] tags so we can read better your code,second of all,,I can't understand what you want


Re: unknown command but still shows. - oscar7610 - 08.04.2012

Look when I type for example /drink the character will make the animation but underneath it types "unknown command" but still the animation is working.
http://imageshack.us/f/845/hellod.png/


Re: unknown command but still shows. - Cjgogo - 08.04.2012

pawn Код:
if(strcmp(cmdtext, "/drink", true))
{
ApplyAnimation(playerid,"BAR","dnk_stndM_loop",4.1 ,1,1,1,1,1,1);
return 1;
}
if(strcmp(cmdtext, "/pee", true))
{
ApplyAnimation(playerid,"PAULNMAC","Piss_in",4.1,1 ,1,1,1,1,1);
return 1;
}
return 0;
}
Try that,and do this for all commands: you had
pawn Код:
if(!strcmp)
,replace it with
pawn Код:
if(strcmp)
,no negation before strcmp


Re: unknown command but still shows. - oscar7610 - 08.04.2012

why ! is used? I did when I type /drink the help menu pops out.


Re: unknown command but still shows. - SuperViper - 08.04.2012

Ignore Cjgogo, you need a ! at the beginning of your strcmp.

On topic: You need to have

pawn Код:
return 1;
at the end of EVERY command.


Re: unknown command but still shows. - Cjgogo - 08.04.2012

SuperViper,problem was fixed,surprisingly by me and another player :P,on another topic,and it's not that I'm a bad scripter,I missunderstood his probleem,:P,and pay more attention to forums,as his problem is fixd on another topic