fix(fuel): fixed currentFuel nil error
This commit is contained in:
1 parent
63c644d277
commit
09d968a521
1 file changed
+1
-1
@@ -24,7 +24,7 @@ end
|
||||
Fuel.SetFuel = function(vehicle, fuel, type)
|
||||
if not DoesEntityExist(vehicle) then return end
|
||||
local currentFuel = Entity(vehicle).state.fuel
|
||||
Entity(vehicle).state.fuel = currentFuel + fuel
|
||||
Entity(vehicle).state.fuel = currentFuel and currentFuel + fuel or fuel
|
||||
return Entity(vehicle).state.fuel
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user