28.04.2018, 17:11
Some vehicles spawn a little below the ground surface. You need to create your vehicles a little higher than the player's position.
I once spawned every vehicle-model at the airport, where the ground is flat.
I recorded the player's position, spawn a vehicle, enter it and get the vehicle's coordinates when the player is at the driver seat.
Then calculate the difference in Z-coordinate and the highest deviation is from the cargobob with 1.6 meters offset.
So if you add 1.6 to the z-coordinate, you should do fine.
All those offsets are recorded in my MySQL database and my script adds the offset to the player's position when a vehicle is created and I haven't had a problem since.
I once spawned every vehicle-model at the airport, where the ground is flat.
I recorded the player's position, spawn a vehicle, enter it and get the vehicle's coordinates when the player is at the driver seat.
Then calculate the difference in Z-coordinate and the highest deviation is from the cargobob with 1.6 meters offset.
So if you add 1.6 to the z-coordinate, you should do fine.
All those offsets are recorded in my MySQL database and my script adds the offset to the player's position when a vehicle is created and I haven't had a problem since.