sure np
testet a bit. the “fix” has introduced a few bugs cant see how far i am when fueling. can only fuel once then it just stops working.
and and then at last did not work testet especially on the blazer
sure np
testet a bit. the “fix” has introduced a few bugs cant see how far i am when fueling. can only fuel once then it just stops working.
and and then at last did not work testet especially on the blazer
Ok i dont use hud of legacy as i use sexy speedometer which has a fuel gauge. I will go in-game with legacy hud.
Ok try this version.
removed
I went and deleted my forked version then i reforked and use the version from there cause i had a dif version and forgot about it.
So now it should have hud and all that.
Let me know if this version works. It should show in L until it hit the petrol max tank Most car are 65 so if your at 20 that mean your at 20 L not 20% and then when you fuel it will go from 20 to 65 if the max petrol tank is 65L
still brakes the script. i can start fueling a car but it removes the hud when done and can still only fuel a car once after that the pumps dont work anymore
The thing is that it’s the exact same code as the esx. Same place same everything. And works fine on esx. So i am really not sure. Check for errors in console. Maybe there is some error that will tell whats going on.
Ok found the error.
Will have new version very soon @Peter
Legacyfuel normal version. If anyone can test and let me know.
LegacyFuel.rar (5.4 KB)
Hi, which file and line to set fuel usage while driving? somehow its too fast
This code in client/main.lua
Citizen.CreateThread(function()
while true do
Citizen.Wait(5000)
local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1))
local engine = Citizen.InvokeNative(0xAE31E7DF9B5B132E, vehicle)
if vehicle and engine then
local plate = GetVehicleNumberPlateText(vehicle)
local rpm = GetVehicleCurrentRpm(vehicle)
local fuel = GetVehicleFuelLevel(vehicle)
local rpmfuelusage = 0
if rpm > 0.9 then
rpmfuelusage = fuel - rpm / 1.8
Citizen.Wait(1000)
elseif rpm > 0.8 then
rpmfuelusage = fuel - rpm / 2.1
Citizen.Wait(1500)
elseif rpm > 0.7 then
rpmfuelusage = fuel - rpm / 3.2
Citizen.Wait(2000)
elseif rpm > 0.6 then
rpmfuelusage = fuel - rpm / 5.1
Citizen.Wait(3000)
elseif rpm > 0.5 then
rpmfuelusage = fuel - rpm / 6.7
Citizen.Wait(4000)
elseif rpm > 0.4 then
rpmfuelusage = fuel - rpm / 7.4
Citizen.Wait(5000)
elseif rpm > 0.3 then
rpmfuelusage = fuel - rpm / 7.9
Citizen.Wait(6000)
elseif rpm > 0.2 then
rpmfuelusage = fuel - rpm / 8.3
Citizen.Wait(8000)
else
rpmfuelusage = fuel - rpm / 8.4
Citizen.Wait(15000)
end
for i = 1, #Vehicles do
if Vehicles[i].plate == plate then
SetVehicleFuelLevel(vehicle, rpmfuelusage)
local updatedfuel = round(GetVehicleFuelLevel(vehicle), 1)
if updatedfuel ~= 0 then
TriggerServerEvent('LegacyFuel:UpdateServerFuelTable', plate, updatedfuel)
table.remove(Vehicles, i)
table.insert(Vehicles, {plate = plate, fuel = rpmfuelusage})
end
break
end
end
if rpmfuelusage < Config.VehicleFailure then
SetVehicleUndriveable(vehicle, true)
elseif rpmfuelusage == 0 then
SetVehicleEngineOn(vehicle, false, false, false)
else
SetVehicleUndriveable(vehicle, false)
end
end
end
end)
This is the one i use and it’s pretty decent. Try it and if you don’t like it just edit it.
Video
This version is almost the original version with few edit.
What’s been edited:
Download Below
Normal version and esx version are edited. I can do vrp but i would need a tester before i push this on github.
So… put a gas pump in game, put the correct coords in (as shown in screenshot with minimap blip) deleted servery cache, restarted server, but still no prompts to fuel the boat. If i no-clip the boat to the gas station nearby it works at the pump, but for whatever reason mine is not? Any help would be appreciated.
Make sure to have the proper hash in the
models = {
[1] = -2007231801,
[2] = 1339433404,
[3] = 1694452750,
[4] = 1933174915,
[5] = -462817101,
[6] = -469694731,
[7] = -164877493
}
I know it seem to be same as other but it might not be the same hash number.
Alright let me know if it works.
Has anyone managed to get to pick up the gallon of fuel at the pump?
where can i buy jerrycans?
Just put them in shop and buy it.
When you put in the store to buy jerrycans when trying to use it to fuel the vehicle it does not come with capacity to fuel.
Where and how can I change the place of the hud, I will have it in the right corner, can you help me please?
Hey, does it matter if the model is dynamic or not? Turns out 19331474915 is listed.
jerrycans when trying to use it to fuel the vehicle it does not come with capacity to fuel.
Is there a way to disable repairing a vehicle via a trainer from adding more fuel?