error 021: symbol already defined: "strtok"
#1

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?
Reply
#2

You need to delete one of them.
Reply
#3

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?
Reply
#4

Probably theres one include which already has strtok, you don't need to have strtok again in your script.
Reply
#5

if i delete that strtok i will get crash
Reply
#6

Show us your "#includes" and tell us how many strtoks are there in your script.
Reply
#7

#include <a_samp>
#include <dini>
#include <sscanf>
#include <core>
#include <float>
#include "../include/gl_common.inc"
Reply
#8

gl_common.inc includes strtok already
Reply
#9

SO WHAT SHOULD I DO?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)