error 021: symbol already defined: "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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error 021: symbol already defined: "strtok" (
/showthread.php?tid=275125)
error 021: symbol already defined: "strtok" -
afizie98 - 08.08.2011
stock 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;
}
C:\Users\Zack\Desktop\samp03csvr_R2-2_win32 - Copy\gamemodes\GWE.pwn(1030) : error 021: symbol already defined: "strtok"
How to fix?
Re: error 021: symbol already defined: "strtok" -
Wesley221 - 08.08.2011
You need to delete one of them.
AW: Re: error 021: symbol already defined: "strtok" -
afizie98 - 08.08.2011
want to delete what?
forward VehRes(vehicleid);
public VehRes(vehicleid)
{
DestroyVehicle(vehicleid);
}
stock Gn(playerid)
{
new pname[24];
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
return pname;
}
stock PFile(playerid)
{
format(file,64,"VipUsers/%s.ini",Gn(playerid));
return file;
}
stock IsValidSkin(SkinID)
{
if((SkinID >= 0 && SkinID <= 2)||(SkinID == 7)||(SkinID >= 9 && SkinID <= 41)||(SkinID >= 43 && SkinID <= 64)||(SkinID >= 66 && SkinID <= 73)||(SkinID >= 75 && SkinID <= 85)||(SkinID >= 87 && SkinID <= 11
||(SkinID >= 120 && SkinID <= 14
||(SkinID >= 150 && SkinID <= 207)||(SkinID >= 209 && SkinID <= 264)||(SkinID >= 274 && SkinID <= 28
||(SkinID >= 290 && SkinID <= 299)) return true;
else return false;
}
stock 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;
}
that smile is 8 ) should no space
Can i delete valid skin?
Re: error 021: symbol already defined: "strtok" -
iPLEOMAX - 08.08.2011
Probably theres one include which already has strtok, you don't need to have strtok again in your script.
AW: error 021: symbol already defined: "strtok" -
afizie98 - 08.08.2011
if i delete that strtok i will get crash
Re: error 021: symbol already defined: "strtok" -
iPLEOMAX - 08.08.2011
Show us your "
#includes" and tell us how many strtoks are there in your script.
AW: error 021: symbol already defined: "strtok" -
afizie98 - 08.08.2011
#include <a_samp>
#include <dini>
#include <sscanf>
#include <core>
#include <float>
#include "../include/gl_common.inc"
Re: error 021: symbol already defined: "strtok" -
sansko - 08.08.2011
gl_common.inc includes strtok already
AW: error 021: symbol already defined: "strtok" -
afizie98 - 08.08.2011
SO WHAT SHOULD I DO?