Mtasa-blue: warpPedIntoVehicle doesn't work when there are too many vehicles streamed in

Created on 8 Apr 2019  路  4Comments  路  Source: multitheftauto/mtasa-blue

Describe the bug
I have a map that contains over 500+ vehicles and players can spawn vehicles themselves with _/vehicle_ command. This command also warps players into newly created vehicle. In any area which has vehicles created with the .map file, players can not warp into this newly created vehicle because warpPedIntoVehicle() doesn't do its job.

To reproduce

  1. Create a map file that contains too many cars.
  2. Test warpPedIntoVehicle to a vehicle that's created with createVehicle(...)
  3. You'll see it's not going to warp into the vehicle.

Expected behaviour
I expect my ped warp into vehicle even though the area is full of vehicles or the .map file has 60000 vehicles.

Screenshots

  • no screenshots. -

Version
I'm using MTA 1.5.6 on Linux with Wine.

bug

Most helpful comment

Did you try using setTimer and then warping the player into the vehicle? Vehicles spawned with createVehicle are not always immediately available and therefore warpPedIntoVehicle would be unable to perform the warp.

All 4 comments

Did you try using setTimer and then warping the player into the vehicle? Vehicles spawned with createVehicle are not always immediately available and therefore warpPedIntoVehicle would be unable to perform the warp.

setTimer with 100 ms works even though there are so many vehicles in map file. This is a confirmed bug.

Can confirm this bug still exists.
If there are 64 streamed vehicles, you can't create a vehicle and warp into it immediately. It works for peds though.

You also can't warp into a vehicle that isn't streamed in, so you need to set the camera matrix there to load the vehicle and then warp.

I investigated this issue. It's related to how vehicles and peds are streamed in. They are loaded asynchronously. The fix is pretty simple. We have to wrap the ped into the vehicle when both entities are streamed in. I'll get to it.

Was this page helpful?
0 / 5 - 0 ratings