SA-MP Forums Archive
Help with tmp = strtok(cmdtext,idx); - 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: Help with tmp = strtok(cmdtext,idx); (/showthread.php?tid=109505)



Help with tmp = strtok(cmdtext,idx); - WardenCS - 20.11.2009

hello,i wanted to compile TGRP (http://forum.sa-mp.com/index.php?topic=130746.0) but ehh,i got some errors

all lines are tmp = strtok(cmdtext,idx);

helps pls

heres the errors
Quote:

C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(3964) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4150) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4279) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(433 : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4382) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4385) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(438 : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4559) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4562) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4615) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4629) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4643) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4657) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4671) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4685) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4699) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4710) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4747) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4841) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(4886) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(5063) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(5067) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(5072) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(5076) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(5092) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(5097) : 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.




Re: Help. - WardenCS - 21.11.2009

BUMP!


Re: Help. - Peter_Corneile - 21.11.2009

You missed a bracket '{' somewhere


Re: Help. - WardenCS - 21.11.2009

can i check it somehow?


Re: Help with tmp = strtok(cmdtext,idx); - WardenCS - 21.11.2009

yeah thanks,i did like that there were error that strtok is defined twice,anyways i added all the lines above //,if i take them away errors come back?


Re: Help with tmp = strtok(cmdtext,idx); - WardenCS - 21.11.2009

strtok one?


Quote:

C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\TPGSERVER.pw n(11600) : error 021: symbol already defined: "strtok"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

11600 line is {


the full is
Quote:

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




Re: Help with tmp = strtok(cmdtext,idx); - WardenCS - 21.11.2009

and the lines what i //ed i delete the //?


Re: Help with tmp = strtok(cmdtext,idx); - WardenCS - 21.11.2009

then the errors come back!((


Re: Help with tmp = strtok(cmdtext,idx); - WardenCS - 21.11.2009

cmd = strtok(cmdtext, idx); that one?

EDIT:i just put them //, i have prob with login :S i can register first time and then i cant login :S
it says already exists login or smth,heres the thing what he says everytime

Quote:

if(udb_Exists(PlayerName(playerid))
{
scm(playerid,c_r,"[ ! ] Account already exists, please use '/login password'.");
return 1;
}

i got prob with it ,it gives me error pls help:

Quote:

C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\89+R.pwn(400 9) : error 001: expected token: ")", but found "{"
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\89+R.pwn(146 19) : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.




Re: Help with tmp = strtok(cmdtext,idx); - dice7 - 21.11.2009

new cmd[256];

On top of OnPlayerCommandText ?