undefined symbol "strtok"
#1

How the hell do i get rid of this error, It's so annoying...
Reply
#2

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;
}
put this somewhere in your script (below includes)
Reply
#3

I did that now i getting this one error.

Код:
C:\Documents and Settings\Jack\Desktop\samp03asvr_R3_win32\gamemodes\bare.pwn(1627) : error 021: symbol already defined: "strtok"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Err.. show us how you are using it.
Reply
#5

Fixed it, I had two strtok's..
Reply
#6

I got the same proplem in my server but can't fix it
Reply
#7

lol if i were you i would just give up strtok and start using a better command processor like Zcmd or Dcmd
Reply
#8

Quote:
Originally Posted by AceFlyer
Посмотреть сообщение
lol if i were you i would just give up strtok and start using a better command processor like Zcmd or Dcmd
Indeed!
BTW This topic is 2 years old o.O
Reply
#9

Quote:
Originally Posted by *ToM*
Посмотреть сообщение
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;
}
put this somewhere in your script (below includes)
I was getting 8 errors until i used this. Thanks Rep added!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)