25.02.2011, 16:09
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:
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.
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;
}
}
Sorry I didn't enter the whole code and sorry for the indentation. Copy and paste failed.