#1

Hello, i'm editing Z-RP gamemode, and i want to add more LS-PD vehicles.
I created one more vehicle and it's give me this error:
pawn Код:
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\zgaming\gamemodes\ZRP.pwn(18981) : error 032: array index out of bounds (variable "FacInfo"
If i delete the line of the new vehicle, the error is gone.
pawn Код:
// Police Vehicles
    FacInfo[1][fCars][0] = CreateVehicle(596,1601.9502,-1683.9442,5.5580,90.0662,0,1,1200); // Crusier1
    FacInfo[1][fCars][1] = CreateVehicle(596,1601.9349,-1688.1353,5.5585,89.8182,0,1,1200); // Crusier2
    FacInfo[1][fCars][2] = CreateVehicle(596,1602.0319,-1691.9169,5.5580,90.1704,0,1,1200); // Crusier3
    FacInfo[1][fCars][3] = CreateVehicle(596,1602.1292,-1695.9916,5.5580,88.9515,0,1,1200); // Crusier4
    FacInfo[1][fCars][4] = CreateVehicle(596,1602.1547,-1700.2701,5.5580,89.4748,0,1,1200); // Crusier5
    FacInfo[1][fCars][5] = CreateVehicle(596,1602.0511,-1704.3525,5.5580,88.4754,0,1,1200); // Crusier6
    FacInfo[1][fCars][6] = CreateVehicle(599,1585.2120,-1667.6892,6.1291,270.2057,0,1,1200); // Ranger1
    FacInfo[1][fCars][7] = CreateVehicle(599,1585.1547,-1671.9965,6.1323,271.1247,0,1,1200); // Ranger2
    FacInfo[1][fCars][8] = CreateVehicle(523,1530.0715,-1688.0465,5.4559,267.5331,1,0,1200); // Bike1
    FacInfo[1][fCars][9] = CreateVehicle(523,1526.7520,-1688.0627,5.4582,268.2188,1,0,1200); // Bike2
    FacInfo[1][fCars][10] = CreateVehicle(523,1529.9504,-1683.8184,5.4578,271.5452,1,0,1200); // Bike3
    FacInfo[1][fCars][11] = CreateVehicle(523,1526.6595,-1683.8164,5.4625,271.1716,1,0,1200); // Bike4
    FacInfo[1][fCars][12] = CreateVehicle(411,1545.3519,-1680.2714,5.6263,88.9375,0,1,1200); // Speed1Infernus
    FacInfo[1][fCars][13] = CreateVehicle(411,1545.3575,-1676.2065,5.6263,90.4601,0,1,1200); // Speed2Infernus
    FacInfo[1][fCars][14] = CreateVehicle(541,1545.1260,-1672.0992,5.5249,90.8087,0,1,1200); // Speed3Bullet
    FacInfo[1][fCars][15] = CreateVehicle(541,1545.1002,-1667.9021,5.5249,90.8901,0,1,1200); // Speed4Bullet
    FacInfo[1][fCars][16] = CreateVehicle(601,1545.0055,-1662.9552,5.6769,88.8576,0,0,1200); // Splashy1
    FacInfo[1][fCars][17] = CreateVehicle(601,1544.9072,-1658.9329,5.6780,88.7145,0,0,1200); // Splashy2
    FacInfo[1][fCars][18] = CreateVehicle(601,1545.0282,-1655.0873,5.6767,89.4033,0,0,1200); // Splashy3
    FacInfo[1][fCars][19] = CreateVehicle(601,1545.0804,-1651.2063,5.6920,90.5362,0,0,1200); // Splashy4
    FacInfo[1][fCars][20] = CreateVehicle(427,1538.9954,-1644.9917,6.0463,180.4178,0,1,1200); // Enforcer1
    FacInfo[1][fCars][21] = CreateVehicle(427,1534.8733,-1644.9760,6.0481,179.3436,0,1,1200); // Enforcer2
    FacInfo[1][fCars][22] = CreateVehicle(427,1531.0992,-1645.0317,6.0463,179.9259,0,1,1200); // Enforcer3
    FacInfo[1][fCars][23] = CreateVehicle(427,1526.8904,-1645.1100,6.0463,180.7001,0,1,1200); // Enforcer4
    FacInfo[1][fCars][24] = CreateVehicle(497,1550.4070,-1707.7499,28.6315,90.2970,0,1,1200); // MAV 1
    FacInfo[1][fCars][25] = CreateVehicle(497,1550.4070,-1644.1296,28.6315,90.2970,0,1,1200); // MAV 2
    FacInfo[1][fCars][26] = CreateVehicle(525,1545.1970,-1684.5497,5.9353,91.5946,0,0,1200); // tow truck
    for(new i=16; i < 24; i++) // Splashy & Enforcer can't be blown up
    {
This is the vehicles, and the tow truck is with the bug
stock of the Leovehicle
pawn Код:
stock IsLeoVehicle(vehicleid)
{
    for(new i=0; i<26; i++)
    {
        if(vehicleid == FacInfo[1][fCars][i]) return 1;
    }
    return 0;
}
Reply
#2

PHP код:
stock IsLeoVehicle(vehicleid)
{
    for(new 
i=0i<27i++)
    {
        if(
vehicleid == FacInfo[1][fCars][i]) return 1;
    }
    return 
0;

Reply
#3

pawn Код:
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\zgaming\gamemodes\ZRP.pwn(18981) : error 032: array index out of bounds (variable "FacInfo")
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\zgaming\gamemodes\ZRP.pwn(18982) : error 032: array index out of bounds (variable "FacInfo")
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\zgaming\gamemodes\ZRP.pwn(18983) : error 032: array index out of bounds (variable "FacInfo")
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\zgaming\gamemodes\ZRP.pwn(18984) : error 032: array index out of bounds (variable "FacInfo")
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\zgaming\gamemodes\ZRP.pwn(18985) : error 032: array index out of bounds (variable "FacInfo")
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\zgaming\gamemodes\ZRP.pwn(18986) : error 032: array index out of bounds (variable "FacInfo")
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\zgaming\gamemodes\ZRP.pwn(18987) : error 032: array index out of bounds (variable "FacInfo")
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\zgaming\gamemodes\ZRP.pwn(18988) : error 032: array index out of bounds (variable "FacInfo")
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\zgaming\gamemodes\ZRP.pwn(18989) : error 032: array index out of bounds (variable "FacInfo")
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\сън\zgaming\gamemodes\ZRP.pwn(18990) : error 032: array index out of bounds (variable "FacInfo")
Reply
#4

How is 'FacInfo' defined? Out of bounds implies that it's size is to small.
Reply
#5

pawn Код:
enum facInfo
{
    fRank0[32],
    fRank1[32],
    fRank2[32],
    fRank3[32],
    fRank4[32],
    fRank5[32],
    fRank6[32],
    fCars[26],
    fDiv1[8],
    fDiv2[8],
    fDiv3[8],
    fDiv4[8]

}
new FacInfo[MAX_FACTIONS][facInfo];
Reply
#6

There you can see that your fCars is set to 26 so you can only use up to 25 + 0 (which also counts) makes 26. Set it to [27] and it will work.
Reply
#7

Fixed thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)