From f04253e68affc661a9cfc7c0e5be2f2dc437e24c Mon Sep 17 00:00:00 2001 From: SKITTLE <92496158+SKITTLE6969@users.noreply.github.com> Date: Thu, 16 May 2024 20:34:58 +0530 Subject: [PATCH] refactor: use vehicle entity from spawn function --- server/hospital.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/server/hospital.lua b/server/hospital.lua index 69bb504..2054f4f 100644 --- a/server/hospital.lua +++ b/server/hospital.lua @@ -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))