Defining
#1

Hey

Quote:

undefined symbol "strtok"

How would I go about defining strtok ?
Reply
#2

Put this in your script:

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
#3

thanks for the reply,

do I need to do the same for idx?

Код:
undefined symbol "idx"
Reply
#4

pawn Код:
new idx;
xD ^^
Reply
#5

Aw!
I fail!

Thanks man, it works great now
Reply
#6

Have you installed commands whitch requires strtok and variables, don't mind posting OnPlayerCommandText then, so that you don't do something wrong.
Sorry, but i just want to know .
Reply
#7

the whole thing?
Reply
#8

If you have so much, just say us if you have commands like:

if(strcmp(cmd, "/command", true) == 0)

=D
Reply
#9

Whole function OnPlayerCommandText if you don't mind, i will scrool it thought rapidly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)