refactor(vehicle): new functions & optimize

This commit is contained in:
Andyyy7666
2023-09-24 11:16:53 +02:00
parent 166baead74
commit c328a8dd50
2 changed files with 211 additions and 99 deletions

View File

@@ -346,18 +346,6 @@ lib.callback.register("ND_Vehicles:getProps", function()
return props
end)
lib.callback.register("ND_Vehicles:getNearbyVehicleById", function(vehId)
local coords = GetEntityCoords(cache.ped)
local vehicles = lib.getNearbyVehicles(coords, 25.0, true)
for i=1, #vehicles do
local veh = vehicles[i]
local state = Entity(veh.vehicle).state
if state and state.id == vehId then
return VehToNet(veh.vehicle)
end
end
end)
lib.callback.register("ND_Vehicles:getVehicleModelMakeLabel", function(model)
local make = GetLabelText(GetMakeNameFromVehicleModel(model))
local name = GetLabelText(GetDisplayNameFromVehicleModel(model))