4 Really annoying ERRORS. - 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: 4 Really annoying ERRORS. (
/showthread.php?tid=270592)
4 Really annoying ERRORS. -
Ben7544 - 21.07.2011
There are the errors :
PHP код:
(26131) : error 008: must be a constant expression; assumed zero
(26131) : error 009: invalid array size (negative, zero or out of bounds)
(26131) : error 036: empty statement
(26131) : fatal error 107: too many error messages on one line
Here's the script :
Код:
for(new h=0; h < MAX_HOUSES; h++)
{
new Text3D:hLabelID[h];
hLabelID[h] = CreateDynamic3DTextLabel(labelString, ADMIN_GREEN, Houses[NewHouseID][hExteriorX],Houses[NewHouseID][hExteriorY],Houses[NewHouseID][hExteriorZ],30.0,0,1);
new labelString[96];
format(labelString, sizeof(labelString), "House %d\n Price: %d", NewHouseID, Houses[h][HousePrice])
}
Line 26131 :
Код:
new Text3D:hLabelID[h];
I would appericate any help, thank you.
Re: 4 Really annoying ERRORS. -
JaTochNietDan - 21.07.2011
new Text3D:hLabelID[h];
That piece of code makes no sense, what are you trying to do? It would appear that your intention is to have an array with all of the house label ID's stored in it. In that case, why are you creating it in a local scope? Create it in the global scope, for example:
pawn Код:
new Text3D:hLabelID[MAX_HOUSES];
To create it in a global scope, make sure it is not placed under a callback or function, preferably at the top of the script where there are most likely many other global variables.
Re: 4 Really annoying ERRORS. -
Ben7544 - 21.07.2011
Ho! thank you, as I haven't seen your message, I managed to fix those errors another way.
But, I've got new one which is WAY-more difficult:
PHP код:
(26133) : error 033: array must be indexed (variable "Houses")
A warning comes along with it :
PHP код:
(26133) : warning 213: tag mismatch
Here's the bugged line :
Код:
Houses[hLabelID] = CreateDynamic3DTextLabel(labelString, ADMIN_GREEN, Houses[NewHouseID][hExteriorX],Houses[NewHouseID][hExteriorY],Houses[NewHouseID][hExteriorZ],30.0,0,1);
Re: 4 Really annoying ERRORS. -
[HiC]TheKiller - 21.07.2011
pawn Код:
for(new h=0; h < MAX_HOUSES; h++)
{
hLabelID[h] = CreateDynamic3DTextLabel(labelString, ADMIN_GREEN, Houses[h][hExteriorX],Houses[h][hExteriorY],Houses[h][hExteriorZ],30.0,0,1);
}
The other error is pretty much saying that you are not creating the house variable correctly. It should be like this
pawn Код:
new Houses[MAX_HOUSES][ENUM_VARIABLE]