2 Errors how to fix? - 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: 2 Errors how to fix? (
/showthread.php?tid=268101)
2 Errors how to fix? -
ServerRestart - 11.07.2011
Quote:
C:\Documents and Settings\Dean\Desktop\Samp server\gamemodes\pp.pwn(40) : error 021: symbol already defined: "strtok"
C:\Documents and Settings\Dean\Desktop\Samp server\gamemodes\pp.pwn(55) : error 047: array sizes do not match, or destination array is too small
|
Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
new IsLogged[MAX_PLAYERS];
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;
What's the problem?
Re: Errors -
Adil - 11.07.2011
As I said earlier, you need to remove strtok function as it is already defined in dini, which is what you are using.
Re: 2 Errors how to fix? -
ServerRestart - 11.07.2011
If i remove that, then pawno crashes. i dont know why
Re: 2 Errors how to fix? -
gold - 11.07.2011
Give me your includes that are at the top.
"#include"
Re: 2 Errors how to fix? -
ServerRestart - 11.07.2011
#include <a_samp>
#include <dini>
#include <dudb>
Re: 2 Errors how to fix? -
Adil - 11.07.2011
You didn't remove the strtok properly, see if you forgot a bracket, because you missed one when you posted the function here.
Re: 2 Errors how to fix? -
gold - 11.07.2011
well, if your running dini, you need to remove it, or remove the strtok, as Adil say, its true, mabye you frogot somthing. check it
Re: 2 Errors how to fix? -
ServerRestart - 11.07.2011
Ok, i have now fixed it. as adil said i forgot some brackets.