SA-MP Forums Archive
Ok guys I got a problem i need some help with. - 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: Ok guys I got a problem i need some help with. (/showthread.php?tid=98953)



Ok guys I got a problem i need some help with. - kujox4 - 24.09.2009

The error codes and Numbers.

Код:
pwn(3313) : error 021: symbol already defined: "strtok"
pwn(3328) : error 047: array sizes do not match, or destination array is too small
The piece of script that it is having a problem with.

Код:
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;
}
I don't know how it strtok is already defined. So. if anyone knows what can cause these errors or knows a trick to fixing them please let me know. Thanks in advance for any help, You guys may give me .


Re: Ok guys I got a problem i need some help with. - aspire5630 - 24.09.2009

Umm not sure, a random geusse. Mabe you already have Strock in your script?


Re: Ok guys I got a problem i need some help with. - kujox4 - 24.09.2009

Ya its like this in the script

Код:
cmd = strtok(cmdtext, idx);
Thats it. So I don't know why its saying that.


Re: Ok guys I got a problem i need some help with. - ded - 24.09.2009

Delete this:

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;
}
If that doesn't work search your script for duplicates.


Re: Ok guys I got a problem i need some help with. - kujox4 - 24.09.2009

I did but that works with the /login /register piece's. So I don't know why its doing that. I did delete it and people just registered and didn't have to /login anymore. They were forever logged in.


Re: Ok guys I got a problem i need some help with. - ded - 24.09.2009

Wtf. What filterscripts, etc. are you using.


Re: Ok guys I got a problem i need some help with. - kujox4 - 24.09.2009

I am trying to put Nazi Zombie TDM's register system in my other script.


Re: Ok guys I got a problem i need some help with. - ded - 24.09.2009

Quote:
Originally Posted by kujox4
I am trying to put Nazi Zombie TDM's register system in my other script.
You're going to have to upload the code to Pastebin otherwise, I really can't help you.


Re: Ok guys I got a problem i need some help with. - kujox4 - 24.09.2009

http://pastebin.com/d37269f7d

There is the onplayerupdate.

So anyways i do appreciate all of your help guys.


Re: Ok guys I got a problem i need some help with. - ded - 24.09.2009

Lol, why have you just shown me OnPlayerUpdate .. strtok isn't even called in there ..