"x_nr" doesn't work.
#1

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.
Reply


Messages In This Thread
"x_nr" doesn't work. - by Biesmen - 25.02.2011, 16:09
Re: "x_nr" doesn't work. - by Vince - 25.02.2011, 16:11
Re: "x_nr" doesn't work. - by Biesmen - 25.02.2011, 16:15
Re: "x_nr" doesn't work. - by admantis - 25.02.2011, 16:23
Re: "x_nr" doesn't work. - by Biesmen - 25.02.2011, 16:28

Forum Jump:


Users browsing this thread: 4 Guest(s)