fix(es_extended/server/classes/vehicle): fix vehicle model extraction

This commit is contained in:
Kenshin13
2024-12-21 01:25:18 +01:00
parent 04ef04e207
commit 4e6e37e708
@@ -38,10 +38,10 @@ Core.vehicleClass = {
vehicleProps = json.decode(vehicleProps) vehicleProps = json.decode(vehicleProps)
if type(vehicleProps.model) ~= "number" then if type(vehicleProps.model) ~= "number" then
model = joaat(model) vehicleProps.model = joaat(vehicleProps.model)
end end
local netId = ESX.OneSync.SpawnVehicle(model, coords.xyz, coords.w, vehicleProps) local netId = ESX.OneSync.SpawnVehicle(vehicleProps.model, coords.xyz, coords.w, vehicleProps)
if not netId then if not netId then
return return
end end
@@ -56,7 +56,7 @@ Core.vehicleClass = {
plate = plate, plate = plate,
entity = entity, entity = entity,
netId = netId, netId = netId,
modelHash = model, modelHash = vehicleProps.model,
owner = owner, owner = owner,
} }
Core.vehicles[plate] = vehicle Core.vehicles[plate] = vehicle