sscanf invalid instruction - 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: sscanf invalid instruction (
/showthread.php?tid=598951)
sscanf invalid instruction -
Squirrel - 18.01.2016
Im getting SSCANF invalid instruction inside my samp server exe because of this
PHP код:
CMD:now(playerid,params[],help) {
new usage[10];
if(sscanf(params,"s[10]",usage)) return Msg(playerid,COLOR_RED,"Usage: /now [here/there]");
if(strcmp(usage,"here",true) == 0) {
new nrmb;
if(sscanf(params,"i",nrmb)) return Msg(playerid,COLOR_RED,"Usage: /now [here] [number]");
switch(nrmb) {
case 1,2,3,4,5: print("Works");
default: print("Invalid number");
}
}
return true;
}
Basically who command is
Re: sscanf invalid instruction -
Jefff - 18.01.2016
pawn Код:
CMD:now(playerid,params[],help)
{
if(isnull(params)) return Msg(playerid,COLOR_RED,"Usage: /now [here/there]");
if(!strcmp(params,"here",true,4) && (!params[4] || params[4] == ' '))
{
new nrmb;
if(sscanf(params[4],"i",nrmb)) return Msg(playerid,COLOR_RED,"Usage: /now [here] [number]");
switch(nrmb)
{
case 1..5: print("Works");
default: print("Invalid number");
}
}
return true;
}
Re: sscanf invalid instruction -
Squirrel - 19.01.2016
Thanks Jeff!