Skip to content

Commit

Permalink
refactor(lib): use vehicle type when spawning vehicles
Browse files Browse the repository at this point in the history
  • Loading branch information
Manason committed Nov 28, 2024
1 parent 8e06398 commit 4a53db5
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 4a53db5

Please sign in to comment.