InZidiuZ / LegacyFuel

A simple, lightweight fuel script for FiveM
GNU General Public License v3.0
78 stars 217 forks source link

Export not working #69

Closed DNDdjay closed 2 years ago

DNDdjay commented 3 years ago

hii i am trying to get the save fuel from the garage on to the car but the export dont work

function SpawnSelectedVeh(vehicle, val) ESX.Game.SpawnVehicle(vehicle.vehicle.model,{x = val.pos[1], y = val.pos[2], z = val.pos[3] + 1}, val.pos[4], function(car) ESX.Game.SetVehicleProperties(car, vehicle.vehicle) SetVehRadioStation(car, "OFF") TaskWarpPedIntoVehicle(player, car, -1) local carPlate = GetVehicleNumberPlateText(car):gsub("^%s(.-)%s$", "%1") local vehicle = CreateVehicle(modelHash, coords.x, coords.y, coords.z, true, false) --TriggerServerEvent("ls:mainCheck", carPlate, car, true) -- IDK what this is used for, but I've seen it in many other garage scripts - use or don't. if val.label == "police" then TriggerServerEvent('t1ger_garage:updateSeizedVehicle', carPlate, false) else TriggerServerEvent('t1ger_garage:updateVehicleState', carPlate, false) end ESX.TriggerServerCallback('t1ger_garage:getVehicleFuel', function(vehFuel) if vehFuel ~= nil then if Config.HasFuelEvent then exports['LegacyFuel']:SetFuel(vehicle) else SetVehicleFuelLevel(car, vehFuel + 0.0) end else SetVehicleFuelLevel(car, 50.0) end end, carPlate) end) end

brunojpsantos commented 3 years ago

Do you have t1ger_garage working?

DNDdjay commented 3 years ago

Do you have t1ger_garage working?

kinda still have some problem with it so i have paid or a other one

InZidiuZ commented 2 years ago

Where's the code snippet where you try to get the fuel level, though? And please, do everyone a favor and use code blocks in the future for when posting code somewhere.

print("This is far more readable!")
DNDdjay commented 2 years ago

try this, its is working for me

RegisterNetEvent("fuel:setFuel") AddEventHandler("fuel:setFuel",function(veh,fuel) SetFuel(veh,fuel) end)

DNDdjay commented 2 years ago

in the client file

InZidiuZ commented 2 years ago

I am the script author, I wasn't asking for help. It seems you figured out your issue, so will close this. You also completely ignored my code block suggestion... :/

DNDdjay commented 2 years ago

sorry did not see that