NULL in pawn, undefined strtok
#4

You can't use a string as an array, you have to do something like #define blabla "NULL".

Look at the wiki. https://sampwiki.blast.hk/wiki/Strtok

pawn Код:
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;
}
Reply


Messages In This Thread
NULL in pawn, undefined strtok - by SEnergy - 30.07.2012, 08:05
Re: NULL in pawn, undefined strtok - by SomebodyAndMe - 30.07.2012, 09:03
Re: NULL in pawn, undefined strtok - by SEnergy - 30.07.2012, 09:07
Re: NULL in pawn, undefined strtok - by SomebodyAndMe - 30.07.2012, 09:09
Re: NULL in pawn, undefined strtok - by Sinner - 30.07.2012, 09:12
Re: NULL in pawn, undefined strtok - by Jochemd - 30.07.2012, 09:14
Re: NULL in pawn, undefined strtok - by SEnergy - 30.07.2012, 09:19
Re: NULL in pawn, undefined strtok - by xDeadlyBoy - 30.07.2012, 11:27
Re: NULL in pawn, undefined strtok - by Jochemd - 30.07.2012, 13:36

Forum Jump:


Users browsing this thread: 1 Guest(s)