Help with strtok and tmp etc.
#7

Quote:
Originally Posted by Bakr
View Post
It's also worth a note that you'll need to get the spaces of the original text anyway.
pawn Code:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
   new
      cmd[ 256 ],
      tmp[ 256 ],
      idx;

   cmd = strtok( cmdtext, idx );
   
   // Inside command
   if( !strcmp( cmd, "/whatever", true ) )
   tmp = strtok( cmdtext, idx );
   new color = strval( tmp );
   tmp = strtok( cmdtext, idx );
   new color2 = strval( tmp );
That half worked... it detects "color" aka the first tmp, but it doesn't detect "color2", the second tmp.
Reply


Messages In This Thread
Help with strtok and tmp etc. - by Jack_Leslie - 25.08.2011, 05:43
Re: Help with strtok and tmp etc. - by =WoR=Varth - 25.08.2011, 05:54
Re: Help with strtok and tmp etc. - by Jack_Leslie - 25.08.2011, 06:04
Re: Help with strtok and tmp etc. - by Bakr - 25.08.2011, 06:08
Re: Help with strtok and tmp etc. - by Jack_Leslie - 25.08.2011, 06:13
Re: Help with strtok and tmp etc. - by Bakr - 25.08.2011, 06:19
Re: Help with strtok and tmp etc. - by Jack_Leslie - 25.08.2011, 06:25
Re: Help with strtok and tmp etc. - by Bakr - 25.08.2011, 06:27
Re: Help with strtok and tmp etc. - by Jack_Leslie - 25.08.2011, 06:29
Re: Help with strtok and tmp etc. - by Bakr - 25.08.2011, 06:30
Re: Help with strtok and tmp etc. - by Jack_Leslie - 25.08.2011, 06:36
Re: Help with strtok and tmp etc. - by Bakr - 25.08.2011, 06:45
Re: Help with strtok and tmp etc. - by Jack_Leslie - 25.08.2011, 06:50
Re: Help with strtok and tmp etc. - by Speed - 25.08.2011, 07:17

Forum Jump:


Users browsing this thread: 1 Guest(s)