Skip to content

Commit

Permalink
refactor: use vehicle entity from spawn function
Browse files Browse the repository at this point in the history
  • Loading branch information
SKITTLE6969 authored May 16, 2024
1 parent 0fde733 commit f04253e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions server/hospital.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ local function wipeInventory(src)
end

lib.callback.register('qbx_ambulancejob:server:spawnVehicle', function(source, vehicleName, vehicleCoords)
local netId = qbx.spawnVehicle({ spawnSource = vehicleCoords or source, model = vehicleName, warp = source })

local veh = NetworkGetEntityFromNetworkId(netId)

local netId, veh = qbx.spawnVehicle({ spawnSource = vehicleCoords or source, model = vehicleName, warp = source })
local vehType = GetVehicleType(veh)
local platePrefix = (vehType == 'heli') and locale('info.heli_plate') or locale('info.amb_plate')
local plate = platePrefix .. tostring(math.random(1000, 9999))
Expand Down

0 comments on commit f04253e

Please sign in to comment.