12.09.2014, 04:05
Quote:
I dont think this code works in any way, i've tried countless solutions and results are the same. So i'd suggest using a different method for this command. you could do something like this
pawn Код:
pawn Код:
|
without sscanf it work, but i need with sscanf
PHP код:
if(!strcmp(cmdtext,"/irc",true))
{
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) return SCM(playerid,-1,"USE: /test1");
if(!strcmp(x_nr,"drugs",true))
{
SCM(playerid,-1,"drugs OK");
return true;
}
else if(!strcmp(x_nr,"mats",true))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SCM(playerid,-1,"USE: /test1 mats [1-2] 1");
if(slot > 2 || slot < 1) return SCM(playerid,-1,"USE: /test1 mats [1-2] 2");
SCM(playerid,-1,"mats OK");
return true;
}
return true;
}