SA-MP Forums Archive
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=271017)



4 Really ANNOYING ERRORS. - Ben7544 - 22.07.2011

There are the errors :
PHP код:
(1313) : error 008must be a constant expressionassumed zero
(1313) : error 029invalid expressionassumed zero
(1313) : error 017undefined symbol "LabelN"
(1313) : fatal error 107too many error messages on one line 
Here's the bugged line :
pawn Код:
new Text3D:LabelS[NewHouseID], Text3D:LabelN[NewHouseID];
Everything connected to the line... :
pawn Код:
stock Create3DHouse()
{
        for(new NewHouseID; NewHouseID<sizeof(Houses); NewHouseID++)
        {
        if(!Houses[NewHouseID][hExteriorY]) continue;
        new string[ 96 ],HouseForSale, HouseNotForSale, WasFSell, WasntFSell;
        new Text3D:LabelS[NewHouseID], Text3D:LabelN[NewHouseID];
        if(strcmp(Houses[NewHouseID][hOwner], "Nobody", true) == 0)
        {
            format(string, sizeof(string), "[House] %d\n buy price: %d (/buyhouse)", NewHouseID, Houses[NewHouseID][HousePrice]);
        }
        else
        {
            format(string, sizeof(string), "[House]\n %d", NewHouseID);
            HouseNotForSale = 1;
            WasntFSell = 1;
        }
        if(HouseForSale == 1)
        {
            WasFSell = 1;
            if(WasntFSell == 1)
            {
            Delete3DTextLabel(LabelN);
            WasntFSell = 0;
            }
            HouseNotForSale = 0;
            LabelS[NewHouseID] = Create3DTextLabel(string,HOUSE_YSELL,Houses[NewHouseID][hExteriorX],Houses[NewHouseID][hExteriorY],Houses[NewHouseID][hExteriorZ],30.0,0,1);
        }
        else if(HouseNotForSale == 1)
        {
            HouseNotForSale = 1;
            WasntFSell = 1;
            if(WasFSell == 1)
            {
                Delete3DTextLabel(LabelS);
                WasFSell = 0;
            }
            LabelN[NewHouseID] = Create3DTextLabel(string,HOUSE_NSELL,Houses[NewHouseID][hExteriorX],Houses[NewHouseID][hExteriorY],Houses[NewHouseID][hExteriorZ],30.0,0,1);
            HouseForSale = 0;
        }
        }
        return 1;
}



Re: 4 Really ANNOYING ERRORS. - jameskmonger - 22.07.2011

pawn Код:
new Text3D:LabelS[MAX_HOUSES], Text3D:LabelN[MAX_HOUSES];



Re: 4 Really ANNOYING ERRORS. - Ben7544 - 22.07.2011

If I will set it into max houses, I wont be able to add more houses, right?

By the way, it gives me those errors :
PHP код:
(1330) : error 032: array index out of bounds (variable "LabelN")
(
1334) : error 032: array index out of bounds (variable "LabelS")
(
1342) : error 032: array index out of bounds (variable "LabelS")
(
1345) : error 032: array index out of bounds (variable "LabelN"



Re: 4 Really ANNOYING ERRORS. - jameskmonger - 22.07.2011

Yes, you will be able to add more.
Try this:
new Text3D:LabelS[500], Text3D:LabelN[500];


Re: 4 Really ANNOYING ERRORS. - Famalamalam - 22.07.2011

You should consider using Incognito's streamer plug-in for those 3D Text labels.


Re: 4 Really ANNOYING ERRORS. - Ben7544 - 22.07.2011

Quote:
Originally Posted by jameskmonger
Посмотреть сообщение
Yes, you will be able to add more.
Try this:
new Text3D:LabelS[500], Text3D:LabelN[500];
It still gives me errors :
PHP код:
(1330)  error 035argument type mismatch (argument 1)
(
1334)  error 033: array must be indexed (variable "LabelS")
(
1342)  error 035argument type mismatch (argument 1)
(
1345)  error 032: array index out of bounds (variable "LabelN"
There are bugged lines :
Line 1330 -
pawn Код:
Delete3DTextLabel(LabelN);
Line 1334 -
pawn Код:
LabelS = Create3DTextLabel(string,HOUSE_YSELL,Houses[NewHouseID][hExteriorX],Houses[NewHouseID][hExteriorY],Houses[NewHouseID][hExteriorZ],30.0,0,1);
Line 1342 -
pawn Код:
Delete3DTextLabel(LabelS);
Line 1345 -
pawn Код:
LabelN = Create3DTextLabel(string,HOUSE_NSELL,Houses[NewHouseID][hExteriorX],Houses[NewHouseID][hExteriorY],Houses[NewHouseID][hExteriorZ],30.0,0,1);
Quote:
Originally Posted by Famalamalam
Посмотреть сообщение
You should consider using Incognito's streamer plug-in for those 3D Text labels.
Can you please explain more detailed?


Re: 4 Really ANNOYING ERRORS. - jameskmonger - 22.07.2011

pawn Код:
Delete3DTextLabel(LabelN[NewHouseID]);
You can do the rest.


Re: 4 Really ANNOYING ERRORS. - Ben7544 - 22.07.2011

Great, thank you.