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;
}
stock sparam(dest[], maxSize = sizeof(dest), const source[], delimiter  = ' ', substrIndex = 0, withRest = 0)
{
  dest[0] = 0; 

  for ( new cur, pre, i = -1; ; cur++ ) 
  {
    if ( source[cur] == 0 ) 
    {
      if ( ++i == substrIndex ) 
        strmid( dest, source, pre, ( withRest ? strlen(source) : cur ), maxSize );

      goto sparam_end;
    }

    if ( source[cur] == delimiter ) 
    {
      if ( ++i == substrIndex ) 
      {
        strmid( dest, source, pre, ( withRest ? strlen(source) : cur ), maxSize );
        goto sparam_end;
      }

      pre = cur + 1;
    }
  }

  sparam_end:
  return; 
}  
 