undefined symbol "strtok" - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: undefined symbol "strtok" (
/showthread.php?tid=111712)
undefined symbol "strtok" -
xLowrider - 03.12.2009
How the hell do i get rid of this error, It's so annoying...
Re: undefined symbol "strtok" -
*ToM* - 03.12.2009
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)
Re: undefined symbol "strtok" -
xLowrider - 03.12.2009
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.
Re: undefined symbol "strtok" -
Grim_ - 03.12.2009
Err.. show us how you are using it.
Re: undefined symbol "strtok" -
xLowrider - 03.12.2009
Fixed it, I had two strtok's..
Re: undefined symbol "strtok" -
Leo_Johnson - 26.09.2011
I got the same proplem in my server but can't fix it
Re: undefined symbol "strtok" -
AceFlyer - 26.09.2011
lol if i were you i would just give up strtok and start using a better command processor like Zcmd or Dcmd
Re: undefined symbol "strtok" -
[MWR]Blood - 26.09.2011
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
Re: undefined symbol "strtok" -
Swisher - 14.01.2014
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!