Skip to content

Commit

Permalink
Check for blacklisted vehicle before doing fuel beep.
Browse files Browse the repository at this point in the history
  • Loading branch information
Randolio authored Sep 29, 2022
1 parent bc8a75e commit d680f97
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1024,12 +1024,22 @@ CreateThread(function()
end
end)

function isElectric(vehicle)
local noBeeps = false
for k, v in pairs(Config.FuelBlacklist) do
if GetEntityModel(vehicle) == GetHashKey(v) then
noBeeps = true
end
end
return noBeeps
end

-- Low fuel
CreateThread(function()
while true do
if LocalPlayer.state.isLoggedIn then
local ped = PlayerPedId()
if IsPedInAnyVehicle(ped, false) and not IsThisModelABicycle(GetEntityModel(GetVehiclePedIsIn(ped, false))) then
if IsPedInAnyVehicle(ped, false) and not IsThisModelABicycle(GetEntityModel(GetVehiclePedIsIn(ped, false))) and not isElectric(GetVehiclePedIsIn(ped, false)) then
if exports[Config.FuelScript]:GetFuel(GetVehiclePedIsIn(ped, false)) <= 20 then -- At 20% Fuel Left
if Menu.isLowFuelChecked then
TriggerServerEvent("InteractSound_SV:PlayOnSource", "pager", 0.10)
Expand Down

0 comments on commit d680f97

Please sign in to comment.