SA-MP Forums Archive
1 error - 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: 1 error (/showthread.php?tid=134712)



1 error - aircombat - 17.03.2010

Код:
new tmp1[256], tmp2[256];	tmp1 = strtok(cmdtext, idx);, tmp2 = strtok(cmdtext, idx);
it gives an error anyone know how to fix?

Код:
error 029: invalid expression, assumed zero



Re: 1 error - [MWR]Blood - 17.03.2010

pawn Код:
new tmp1[256], tmp2[256];   tmp1 = strtok(cmdtext, idx), tmp2 = strtok(cmdtext, idx);
Try with this... I'm not sure...


Re: 1 error - FlatMaN - 17.03.2010

or try this

Код:
new tmp1[256], tmp2[256];	tmp1 = strtok(cmdtext, idx); tmp2 = strtok(cmdtext, idx);



Re: 1 error - RenisiL - 17.03.2010

or try this

Код:
new tmp1[256], tmp2[256];
tmp1 = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);



Re: 1 error - Correlli - 17.03.2010

And try not to use 256 cells when you don't need them.


Re: 1 error - aircombat - 17.03.2010

Quote:
Originally Posted by Don Correlli
And try not to use 256 cells when you don't need them.
well can u tell me what's the diffrence in cells , like what is diffrent between : new string[128] and new string[256]?


Re: 1 error - Correlli - 17.03.2010

Quote:
Originally Posted by [AC
Etch ]
well can u tell me what's the diffrence in cells , like what is diffrent between : new string[128] and new string[256]?
Learn PAWN basics and you'll know. That is the basic thing.

http://forum.sa-mp.com/index.php?topic=78026.90


Re: 1 error - biltong - 17.03.2010

Quote:
Originally Posted by [AC
Etch ]
Код:
new tmp1[256], tmp2[256];	tmp1 = strtok(cmdtext, idx);, tmp2 = strtok(cmdtext, idx);
it gives an error anyone know how to fix?

Код:
error 029: invalid expression, assumed zero
pawn Код:
new tmp1[128], tmp2[128];
tmp1 = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
fixed.

On the cells point, if you have too many cells in your script you will waste memory. = Not good. You should basically never use 256 cells because the SA:MP chat box can only output 128 characters and can only input 128 characters.


Re: 1 error - aircombat - 17.03.2010

thnx 4 the tutorial very much


Re: 1 error - cozza123456 - 17.03.2010

Thanks, even i learnt from this when i wasn't supposed too...