SA-MP Forums Archive
Admin tutorial with dini - 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: Admin tutorial with dini (/showthread.php?tid=224566)



Admin tutorial with dini - Freght - 12.02.2011

Hello guys,
I have got an admin system from a tutorial, but there are 2 errors when i compile:

C:\DOCUME~1\casa\DOCUME~1\DOWNLO~1\SERVER~1\MADEIN ~1\FILTER~1\AdminS.pwn(229) : error 021: symbol already defined: "strtok"
C:\DOCUME~1\casa\DOCUME~1\DOWNLO~1\SERVER~1\MADEIN ~1\FILTER~1\AdminS.pwn(243) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

Now i will put the error zone here:

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;
}

Pratically it says that strtok is already defined lol.
idk how make, someone help me pls!


Re: Admin tutorial with dini - int3s0 - 12.02.2011

strtok is already defined in your script or include.
So try with deleting that.


Re: Admin tutorial with dini - Mean - 12.02.2011

Also, use [ pawn ] for the code.
And yes, you already got the "strtok" stock somewhere in your script, so you have it twice, just delete it. The error says it all...