Help please. A few errors.(strtok)
#1

Hello, I have just started to learn Pawn coding. I took TGP Gamemode found here and found may errors. (Most where about array size not matching, which I was able to fix by using skills I picked up from school when I learned VB and VC, and using the Wiki.) Now I get these errors.

Код:
C:\Users\Randall\Downloads\samp\TPG Roleplay\TPG Roleplay\gamemodes\TPGSERVER.pwn(11600) : error 021: symbol already defined: "strtok"
C:\Users\Randall\Downloads\samp\TPG Roleplay\TPG Roleplay\gamemodes\TPGSERVER.pwn(11615) : error 047: array sizes do not match, or destination array is too small
And it points me to here.

Код:
stock strtok(const string[], &index,seperator=' ')
{
 	new length = strlen(string);
	new offset = index;
	new result[256];
	while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
  {
		result[index - offset] = string[index];
		index++;
	}

	result[index - offset] = EOS;
	if ((index < length) && (string[index] == seperator))
	{
	index++;
	}
	return result;
}
Now I did some random test which included reming this out when I did that I could register but not login. also I could spawn but with no money, which if I am correct from what I saw in the scripting you do start with money.

I know I have to remove a strtok but i have no clue from where.
Reply


Messages In This Thread
Help please. A few errors.(strtok) - by MichalGusta - 07.11.2009, 04:48
Re: Help please. A few errors.(strtok) - by jesse237 - 09.11.2009, 19:58

Forum Jump:


Users browsing this thread: 2 Guest(s)