Skip to content

Commit

Permalink
fix(bridge/qb/server/functions): wait for vehicle owner to be player …
Browse files Browse the repository at this point in the history
…when spawning vehicle
  • Loading branch information
Manason authored Nov 6, 2023
1 parent a2b18e7 commit 6443232
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bridge/qb/server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ end
function functions.SpawnVehicle(source, model, coords, warp)
local netId = SpawnVehicle(source, model, coords, warp)
if not netId then return end
return NetworkGetEntityFromNetworkId(netId)
local veh = NetworkGetEntityFromNetworkId(netId)
while NetworkGetEntityOwner(veh) ~= source do Wait(0) end
return veh
end

---@deprecated use SpawnVehicle from imports/utils.lua
Expand Down

0 comments on commit 6443232

Please sign in to comment.