open.mp forum
[Pawn] Array index out of bounds - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Array index out of bounds (/showthread.php?tid=1945)



Array index out of bounds - Z3fRaN - 2021-04-25

trying to create server sided vehicles

Code:
enum vInfo

{

vehicletype,

Float:vx,

Float:vy,

Float:vz,

Float:rotation,

vcolor1,

vcolor2,

respawn_delay,

addsiren=0

}



new VehicleInfo[MAX_VEHICLES][vInfo];



stock CreateVehicleEx(modelid, Float:x, Float:y, Float:z, Float:z_rotation, color1, color2, vrespawn_delay, vaddsiren=0)

{

new vehicle;

vehicle = CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren);

VehicleInfo[vehicle][vehicletype] = modelid;

VehicleInfo[vehicle][vx] = x; -?Array index out of bounds at variable "vehicleinfo"

VehicleInfo[vehicle][vy] = y; -?Array index out of bounds at variable "vehicleinfo"

VehicleInfo[vehicle][vz] = z;?-?Array index out of bounds at variable "vehicleinfo"

VehicleInfo[vehicle][rotation] = z_rotation; -?Array index out of bounds at variable "vehicleinfo"

VehicleInfo[vehicle][vcolor1] = color1;?-?Array index out of bounds at variable "vehicleinfo"

VehicleInfo[vehicle][vcolor2] = color2;??-?Array index out of bounds at variable "vehicleinfo"

VehicleInfo[vehicle][respawn_delay] = vrespawn_delay; -?Array index out of bounds at variable "vehicleinfo"

VehicleInfo[vehicle][addsiren] = vaddsiren;?-?Array index out of bounds at variable "vehicleinfo"

return 1;

}



RE: Array index out of bounds - Radical - 2021-04-25

PHP Code:
vehicle CreateVehicle(vehicletypeFloat:xFloat:yFloat:zFloat:rotationcolor1color2respawn_delayaddsiren);

// >>>

vehicle CreateVehicle(modelidxyzz_rotationcolor1color2vrespawn_delayvaddsiren); 



RE: Array index out of bounds - Z3fRaN - 2021-04-25

Got it figured, thanks.