-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description of the bug
When spawning a vehicle (garage, dealership test drive, or admin spawn), the player sometimes receives a "no_fuel" notification, even though the vehicle actually has fuel.
The notification disappears right after, once the fuel syncs correctly.
Steps to reproduce
- Spawn a vehicle from garage, dealership or as admin.
- Notice that sometimes a "no_fuel" notification pops up.
- A second later, the fuel level shows correctly and the car has fuel.
Expected behavior
The notification should not appear if the fuel value has not yet been synced from the server.
Actual behavior
A false "no_fuel" notification is displayed briefly right after spawn, then the fuel HUD corrects itself.
Possible cause
In client/cl_fuel.lua, the thread that shuts off the engine checks:
if vehFuelLevel <= vehFuelShutoffLevel then
QBCore.Functions.Notify(Lang:t("no_fuel"), 'error', 3500)Suggested fix
Add a condition to ignore invalid fuel values at spawn:
if vehFuelLevel and vehFuelLevel > 0.1 and vehFuelLevel <= vehFuelShutoffLevel then
-- shut off engine and notify
endEnvironment
cdn-fuel version: [2.1.9]
Framework: [QBCore]
Server build: [3095]
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working