/move [x] [y] [z]
#9

Quote:
Originally Posted by brett7
it says undefined symbol strtok did you define it right?

pawn Code:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
 
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
pawn Code:
strtok(const string[], &index, separator = ' ')
{
  new length = strlen(string);
  while ((index < length) && (string[index] <= separator))
  {
    index++;
  }
  new offset = index;
  new result[20];
  while ((index < length) && (string[index] > separator) && ((index - offset) < (sizeof(result) - 1)))
  {
    result[index - offset] = string[index];
    index++;
  }
  result[index - offset] = EOS;
  return result;
}
Reply


Messages In This Thread
/move [x] [y] [z] - by hazdog - 20.03.2009, 23:31
Re: /move [x] [y] [z] - by brett7 - 20.03.2009, 23:34
Re: /move [x] [y] [z] - by ICECOLDKILLAK8 - 20.03.2009, 23:40
Re: /move [x] [y] [z] - by hazdog - 21.03.2009, 02:22
Re: /move [x] [y] [z] - by Norn - 21.03.2009, 02:25
Re: /move [x] [y] [z] - by hazdog - 21.03.2009, 02:25
Re: /move [x] [y] [z] - by Donny_k - 21.03.2009, 08:53
Re: /move [x] [y] [z] - by LarzI - 21.03.2009, 10:55
Re: /move [x] [y] [z] - by MenaceX^ - 21.03.2009, 11:02

Forum Jump:


Users browsing this thread: 3 Guest(s)