16.04.2014, 16:40
array index out of bounds
that happens if you do something like this:
make sure that hitmancar has 12 "slots"
and also, we start with 0 when it comes to array indexes, not 1
example:
so it should look like this
that happens if you do something like this:
pawn Код:
new charStr[10];
charStr[5] = 'a';//valid
charStr[11] = 'b';//invalid, it's not within the address-space you've declared ([10 * 4 bytes])
and also, we start with 0 when it comes to array indexes, not 1
example:
pawn Код:
hitmancar[0] = AddStaticVehicleEx(402,1072.6940,-294.4568,73.8174,184.0207,0,0, 60000);//BUFFALO
hitmancar[1] = AddStaticVehicleEx(560,1056.7974,-296.0228,73.6476,220.6447,0,0, 60000);//SULTAN
hitmancar[2] = AddStaticVehicleEx(402,1066.8027,-294.7601,73.7560,180.5475,0,0, 60000);//BUFFALO
//and so on until 11
Код:
new hitmancar[12]; hitmancar[0] = AddStaticVehicleEx(402,1072.6940,-294.4568,73.8174,184.0207,0,0, 60000);//BUFFALO hitmancar[1] = AddStaticVehicleEx(560,1056.7974,-296.0228,73.6476,220.6447,0,0, 60000);//SULTAN hitmancar[2] = AddStaticVehicleEx(402,1066.8027,-294.7601,73.7560,180.5475,0,0, 60000);//BUFFALO hitmancar[3] = AddStaticVehicleEx(469,1014.9276,-340.1649,74.0039,268.3130,1,3, 60000); //SPARROW hitmancar[4] = AddStaticVehicleEx(521,1085.8807,-290.4791,73.5638,138.1973,0,0,60000); //FCR-900 hitmancar[5] = AddStaticVehicleEx(521,1059.5479,-290.2026,73.5641,202.6040,0,0,60000); //FCR-900 hitmancar[6] = AddStaticVehicleEx(560,1087.6539,-295.5521,73.6510,136.4514,0,0,60000); //SULTAN hitmancar[7] = AddStaticVehicleEx(487,1042.5630,-352.4952,74.1504,1.1824,0,0,60000); //MAVERICK hitmancar[8] = AddStaticVehicleEx(469,1015.2458,-332.7486,74.0039,266.4392,1,3, 60000); //SPARROW hitmancar[9] = AddStaticVehicleEx(469,1015.1457,-325.4256,74.0042,271.3375,1,3, 60000); //SPARROW hitmancar[10] = AddStaticVehicleEx(469,1032.4514,-308.5603,74.0229,181.5628,1,3, 60000); //SPARROW hitmancar[11] = AddStaticVehicleEx(402,1078.1270,-294.4131,73.8107,178.4071,0,0, 60000); //BUFFALO