SA-MP Forums Archive
"x_nr" doesn't work. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: "x_nr" doesn't work. (/showthread.php?tid=231399)



"x_nr" doesn't work. - Biesmen - 25.02.2011

I've been trying to find out why this piece of script doesn't work. I compared it with other working commands, but it doesn't work at all..

This is the code I am using:

pawn Код:
if(strcmp(cmd, "/test", true) == 0)
{
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /test ptest");        
return 1;
}      
if(strcmp(x_nr,"ptest",true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "Test worked.");
return 1;
}
}
It acts like I didn't even type "ptest". It keeps saying "USAGE:" blabla.

Sorry I didn't enter the whole code and sorry for the indentation. Copy and paste failed.


Re: "x_nr" doesn't work. - Vince - 25.02.2011

ZCMD + SSCANF


Re: "x_nr" doesn't work. - Biesmen - 25.02.2011

Quote:
Originally Posted by Vince
Посмотреть сообщение
ZCMD + SSCANF
I'd rather don't switch a command of more than 100 lines to zcmd + sscanf. this used to work before, somehow I am doing something wrong.


Re: "x_nr" doesn't work. - admantis - 25.02.2011

What is exactly 'x_nr'. I've seen it in PenLS thought. And why x_nr size is 256?


Re: "x_nr" doesn't work. - Biesmen - 25.02.2011

You use this to make sections, e.g "/help section".

I've indeed seen this in PenLs. I thought most scripts use x_nr for this. Actually, most people call it "tmp" probably.