Problem with defining. - 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)
+--- Thread: Problem with defining. (
/showthread.php?tid=310310)
Problem with defining. -
Typhome - 11.01.2012
I have one define that's:
#define AUTOLIIMIT 100
And variable:
new autosysteem;
I've tried that:
new CarInfo[AUTOLIIMIT+autosysteem][cInfo];
But it will show errors and warnings.
Any idea how fix that problem? Thanks!
Error & Warning
Код:
error 008: must be a constant expression; assumed zero
warning 224: indeterminate array size in "sizeof" expression (symbol "")
warning 224: indeterminate array size in "sizeof" expression (symbol "")
warning 224: indeterminate array size in "sizeof" expression (symbol "")
warning 224: indeterminate array size in "sizeof" expression (symbol "")
warning 224: indeterminate array size in "sizeof" expression (symbol "")
warning 224: indeterminate array size in "sizeof" expression (symbol "")
warning 224: indeterminate array size in "sizeof" expression (symbol "")
warning 224: indeterminate array size in "sizeof" expression (symbol "")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: Problem with defining. -
Psymetrix - 11.01.2012
You can't do it like that. I just posted this but it explains exactly why you can't.
http://forum.sa-mp.com/showthread.ph...=pawn-lang.pdf
pawn Код:
new CarInfo[AUTOLIIMIT][cInfo];
Re: Problem with defining. -
Typhome - 11.01.2012
Then how do it.. :/ I need add too "autosysteem" value
(to AUTOLIIMIT for CarInfo)
Re: Problem with defining. -
Psymetrix - 11.01.2012
If your saving information about each vehicle,
new CarInfo[MAX_VEHICLES][cInfo]; Is enough to record information about every vehicle since the limit is 2000.
Array sizes cannot be changed dynamically by using a variable as the size since they are handled by the Pre-Processor.