something strange happend to my gm?! -
Gamer007 - 10.05.2009
I don't know what the hell happend but it's something about strtok and whole commandtext, it gives me 26 errors and i don't know even why when i put strtok in commandtext i get only 4 errors but the errors are these:
Code:
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(1826) : error 029: invalid expression, assumed zero
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(1826) : error 029: invalid expression, assumed zero
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(1826) : error 017: undefined symbol "index"
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(1826) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
the line is this:
Code:
strtok(const string[], &index)
{
I did something i think with the strtok and now it shows everyline who is got something to do with strtok please someone ?:SSS!!
EDIT: This is what i get when i delete strtok, because it says it's already defined if i put it above the OnGameModeInit
Code:
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(1831) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(1900) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(1908) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(1968) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2001) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2050) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2086) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2126) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2163) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2196) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2228) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2260) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2293) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2325) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2357) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2408) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2457) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2525) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2537) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2560) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2608) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2654) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2709) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2756) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2768) : error 047: array sizes do not match, or destination array is too small
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(2784) : error 047: array sizes do not match, or destination array is too small
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
26 Errors.
It points to:
Code:
tmp = strtok(cmdtext, idx);
the every error points to this
Re: something strange happend to my gm?! -
Andom - 10.05.2009
More code please! 1 rule is unuseless.
Re: something strange happend to my gm?! -
Gamer007 - 10.05.2009
I posted everything i could, i just did something i can't remember and now i get the errors saying there is something wrong with the tmp = strtok(cmdtext,idx); , i deleted STRTOK command cuz it said it's already defined what more do you want?
Re: something strange happend to my gm?! -
Nero_3D - 10.05.2009
you use a strtok function that use an to big array, post your strtok function and we will fix it
Re: something strange happend to my gm?! -
Gamer007 - 10.05.2009
Code:
stock strtok(const string[], &index,seperator=' ')
{
new length = strlen(string);
new offset = index;
new result[128];
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;
}
Ok listen it was this function aight? I deleted the function and then i noticed a thing, i tought i would try new tmp and cmd max increase from 128 to 256 in commandtext and i did it, i didn't get any errors but look:
Code:
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(866) : warning 202: number of arguments does not match definition
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(867) : warning 202: number of arguments does not match definition
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(868) : warning 202: number of arguments does not match definition
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(869) : warning 202: number of arguments does not match definition
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(870) : warning 202: number of arguments does not match definition
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\filterscripts\dAdmin.pwn(1514) : warning 209: function "OnPlayerConnect" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Header size: 3064 bytes
Code size: 118200 bytes
Data size: 1040276 bytes
Stack/heap size: 16384 bytes; estimated max. usage=4436 cells (17744 bytes)
Total requirements: 1177924 bytes
6 Warnings.
Is this normal?
DON'T PAY ATTENTION TO THE WARNINGS
Re: something strange happend to my gm?! -
Nero_3D - 10.05.2009
use that strtok -
https://sampwiki.blast.hk/wiki/Strtok - with that you can let the cmd and tmp array small
and dont ignore warnings, they are there for a good reason, post the line 866-870
and the last warning
pawn Code:
public OnPlayerConenct(playerid)
{
//Some code
return 1; //put that at the end
}
Re: something strange happend to my gm?! -
Gamer007 - 10.05.2009
Well if u want to see those lines u asked go here:
http://forum.sa-mp.com/index.php?topic=101970.0
It's my older topic, nobody didn't answer me there i need an answer there please answer me there if you can, and for the warning u posted, i already fixed it. But thanks anyways.