PDA

View Full Version : undefined symbol "strtok"


xLowrider
03/12/2009, 12:43 PM
How the hell do i get rid of this error, It's so annoying...

*ToM*
03/12/2009, 12:54 PM
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)

xLowrider
03/12/2009, 10:23 PM
I did that now i getting this one error.

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


1 Error.

Grim_
03/12/2009, 10:27 PM
Err.. show us how you are using it.

xLowrider
03/12/2009, 10:29 PM
Fixed it, I had two strtok's..

Leo_Johnson
26/09/2011, 08:01 AM
I got the same proplem in my server but can't fix it :(

AceFlyer
26/09/2011, 09:03 AM
lol if i were you i would just give up strtok and start using a better command processor like Zcmd or Dcmd

[MWR]Blood
26/09/2011, 09:05 AM
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

Swisher
14/01/2014, 01:06 AM
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!