"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
#2

ZCMD + SSCANF
Reply
#3

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

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

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


Forum Jump:


Users browsing this thread: 4 Guest(s)