Sna-aaa / esx-sna-fuel

Fuel script that cover all vehicles, fuel, electric, air, sea
8 stars 8 forks source link

Having Issues With Exports #1

Closed MaliciousSnip3r closed 1 year ago

MaliciousSnip3r commented 1 year ago

I use cd_garage and I use your export but my vehicles always come out with 50% fuel no matter what level its put in at.

Sna-aaa commented 1 year ago

Hello, If you use my exports in your garage it is not the problem (you can verify that in your database) As my scripts let always 50% of the fuel in the standard GetFuelLevel native, i bet it is your hud that use GetFuelLevel instead of the export Another good test is to check if the car stops after consuming all the fuel to be sure the script is working

MaliciousSnip3r commented 1 year ago

I can confirm thats working as both electric and gas vehicles shut off on depletion. It does go into the Database at 50.0. Not sure if this is on cd_garage's end. But when I print the export for get fuel it does read correctly to what the hud says when I put it in. Cd_garage believes its in the export.

"think your export is incorrect your function requires 2 variables and the export requries one"

I dont understand what the problem is if the exports run just like Legacy Fuel.

Sna-aaa commented 1 year ago

Ok if it goes into your DB for 50% the problem is in the export of the garage And it is always the same problem, the line GetFuelLevel(veh) will always return 50% exports['qb-sna-fuel']:GetFuel(veh) will give you the correct value So if your cd_garage give you 50% in the database, it is because there is a GetFuelLevel line that is wandering somewhere in your code

I don't understand the export variables that you mention as the exports are EXACTLY the same as LegacyFuel (to have a compatibility and ease of installation)