altv-issues
altv-issues copied to clipboard
Crash when spawning a vehicle client-side
Description of the problem
For some players the game crashes when the player is moved to the car showroom. He's teleported to LS underground, LS store interior is displayed and a vehicle is created client-side + UI is loaded.
Crash ids:
e1253cff-a223-4442-93e9-e5b69f4731f3 (Player 1)
6cb3097a-fe3d-4612-bbef-3e42fc865d88 (Player 1)
a80ec49b-3b97-40b3-83d6-fdaf9a14aac1 (Player 2)
Deluvas mentioned the crash is to do with oil level and lights indicator, but none of those features are used when the crash occurs.
Reproduction steps
This issue only seems to happen on certain computers, can't reproduce it, but here is the code we use to spawn the showcase vehicle:
VehicleShop.vehicle = new alt.LocalVehicle(model, alt.Player.local.dimension, VehicleShop.vehiclePos, useRotation);
await alt.Utils.waitFor(() => VehicleShop.hasVehicleSpawned(), 10_000);
native.setVehicleColours(VehicleShop.vehicle.scriptID, primaryColor, secondaryColor);
native.setVehicleNumberPlateText(VehicleShop.vehicle.scriptID, "LMG5");
native.setVehicleDoorsLockedForAllPlayers(VehicleShop.vehicle.scriptID, true);
native.setVehicleDirtLevel(VehicleShop.vehicle.scriptID, 0.0);
native.setEntityInvincible(VehicleShop.vehicle.scriptID, true);
native.setVehicleLivery(VehicleShop.vehicle.scriptID, 0);
native.setVehicleLivery2(VehicleShop.vehicle.scriptID, 0);
// Freeze vehicle just in case player tries to enter it
native.freezeEntityPosition(VehicleShop.vehicle.scriptID, true);
if(VehicleShop.vehicleRotationEnabled && !AutomaticEntityRotation.has(VehicleShop.vehicle)) {
AutomaticEntityRotation.start(VehicleShop.vehicle, VehicleShop.ROTATION_SPEED);
}
Expected behaviour
Should not crash and spawn the vehicle successfully
Additional context
No response
Operating system
Client: Windows 11
Version
Client: 16.0.69
Crashdump ID
e1253cff-a223-4442-93e9-e5b69f4731f3
Confirmation of issue's presence
- [X] By submitting this ticket, I affirm that I have verified the presence of this issue on the latest developer version available at the time of writing this ticket.