error 032: array index out of bounds (variable "HouseInfo")
#1

PHP код:
            new All[300], Locked[32], All1[300], All2[300], Houseidx;
            
Houseidx HouseStatsHouseID[playerid];
            if(
HouseInfo[Houseidx][hDoors] == 0){Locked "UnLocked";}
            else if(
HouseInfo[Houseidx][hDoors] == 1){Locked "Locked";}
            
format(Allsizeof(All), "ID: %d | Owner: %s | Address: %s %d | Level: %d | Price: $%d | Doors: %s | Interior: %d",
            
HouseidxHouseInfo[Houseidx][hOwner], HouseInfo[Houseidx][hAddress], HouseidxHouseInfo[Houseidx][hLevel], HouseInfo[Houseidx][hPrice], LockedHouseInfo[Houseidx][hInterior]);
            
format(All1sizeof(All1), "Weapon: %d | Ammo: %d | Weapon1: %d | Ammo1: %d | Weapon2: %d | Ammo2: %d | Weapon3: %d | Ammo3: %d",
            
HouseInfo[Houseidx][hWeapon][0], HouseInfo[Houseidx][hAmmo][0], HouseInfo[Houseidx][hWeapon][1], HouseInfo[Houseidx][hAmmo][1], HouseInfo[Houseidx][hWeapon][2], HouseInfo[Houseidx][hAmmo][2], HouseInfo[Houseidx][hWeapon][3], HouseInfo[Houseidx][hAmmo][3]);
            
format(All2sizeof(All2), "Weapon4: %d | Ammo4: %d | Money: $%d | Materials: %d | Weed: %d | Cocaine: %d | Dressing Room: %d",
            
HouseInfo[Houseidx][hWeapon][5], HouseInfo[Houseidx][hAmmo][5], HouseInfo[Houseidx][hMoney], HouseInfo[Houseidx][hMaterials], HouseInfo[Houseidx][hWeed], HouseInfo[Houseidx][hCocaine], HouseInfo[Houseidx][hDressingRoom]);
            
format(stringsizeof(string), "%s\n%s\n%s"AllAll1All2);
            
ShowDialog(playeridShow:DialogID25DIALOG_STYLE_MSGBOX"{9E9211}House Info"string"OK""Back"); 
Код HTML:
error 032: array index out of bounds (variable "HouseInfo")
Error Line:
PHP код:
            format(All2sizeof(All2), "Weapon4: %d | Ammo4: %d | Money: $%d | Materials: %d | Weed: %d | Cocaine: %d | Dressing Room: %d",
            
HouseInfo[Houseidx][hWeapon][5], HouseInfo[Houseidx][hAmmo][5], HouseInfo[Houseidx][hMoney], HouseInfo[Houseidx][hMaterials], HouseInfo[Houseidx][hWeed], HouseInfo[Houseidx][hCocaine], HouseInfo[Houseidx][hDressingRoom]); 
Reply
#2

pawn Код:
enum houseinfodata
{
    hWeapon[6],
    hAmmo[6]
}
or
pawn Код:
HouseInfo[..][hWeapon][4]
// same for ammo in your format(..)
Reply
#3

Thanks. +rep
PHP код:
HouseInfo[Houseidx][hWeapon][5
Should be:
PHP код:
HouseInfo[Houseidx][hWeapon][4
What a noob mistake
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)