Skip to content

Commit

Permalink
fix(server/functions): fix teleporting player into vehicle on spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
Manason committed Jun 3, 2023
1 parent bca950f commit 288ed31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ function QBCore.Functions.CreateVehicle(source, model, coords, warp)
local vehicleType = GetVehicleType(tempVehicle)
DeleteEntity(tempVehicle)
local veh = CreateVehicleServerSetter(model, vehicleType, coords.x, coords.y, coords.z, coords.w)
while not DoesEntityExist(veh) do Wait(0) end
if warp then TaskWarpPedIntoVehicle(GetPlayerPed(source), veh, -1) end
Wait(0)
if warp then SetPedIntoVehicle(GetPlayerPed(source), veh, -1) end
Entity(veh).state:set('initVehicle', true, true)
return NetworkGetNetworkIdFromEntity(veh)
end
Expand Down

0 comments on commit 288ed31

Please sign in to comment.