Hey,
following problem:
in the case of repairs with a repair kit or by the mechanics, the tank of the repaired vehicle is filled up to 65%. No matter how full it is. How to remove this function? Use esx_repairkit, esx_mechanicjob and esx_fuel.
You could probably use something like this to fix your issue
RegisterNetEvent('esx_mechanicjob:onFixkit')
AddEventHandler('esx_mechanicjob:onFixkit', function()
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then
local vehicle
if IsPedInAnyVehicle(playerPed, false) then
vehicle = GetVehiclePedIsIn(playerPed, false)
else
vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71)
end
if DoesEntityExist(vehicle) then
local realFuelLevel = GetVehicleFuelLevel(vehicle) -- Get the fuel level before fixing the vehicle
TaskStartScenarioInPlace(playerPed, 'PROP_HUMAN_BUM_BIN', 0, true)
CreateThread(function()
Wait(20000)
SetVehicleFixed(vehicle)
SetVehicleDeformationFixed(vehicle)
SetVehicleUndriveable(vehicle, false)
ClearPedTasksImmediately(playerPed)
ESX.ShowNotification(_U('veh_repaired'))
Wait(500)
if GetVehicleFuelLevel(vehicle) ~= realFuelLevel then -- If new fuel level is different than the value we got before
SetVehicleFuelLevel(vehicle, realFuelLevel) -- then set the fuel level to the same value as before
end
end)
end
end
end)
I haven’t tested this but give it a try.
1 Like
sounds good will test it tomorrow
thank u:)
Thank u man, works perfect. now i have to find the part of the script when it gets repaired when u close the tuning-menu:)
1 Like
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.