Skip to content

Commit

Permalink
refactor(lib): use vehicle type when spawning vehicles (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
Manason authored Dec 1, 2024
1 parent 38473d9 commit 712be57
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,14 @@ if isServer then
coords = vec4(pedCoords.x, pedCoords.y, pedCoords.z, GetEntityHeading(source))
end

local tempVehicle = CreateVehicle(model, 0, 0, -200, 0, true, true)
while not DoesEntityExist(tempVehicle) do Wait(0) end
local vehicleType = exports.qbx_core:GetVehiclesByHash(model).type
if not vehicleType then
local tempVehicle = CreateVehicle(model, 0, 0, -200, 0, true, true)
while not DoesEntityExist(tempVehicle) do Wait(0) end

local vehicleType = GetVehicleType(tempVehicle)
DeleteEntity(tempVehicle)
vehicleType = GetVehicleType(tempVehicle)
DeleteEntity(tempVehicle)
end

local attempts = 0

Expand Down

0 comments on commit 712be57

Please sign in to comment.