Skip to content

Commit

Permalink
Merge pull request #49 from Randolio/main
Browse files Browse the repository at this point in the history
Blacklist vehicles from showing the "low on fuel" notification. (Electric Vehicles)
  • Loading branch information
MonkeyWhisper authored Sep 29, 2022
2 parents 6740b21 + cc98021 commit db83503
Show file tree
Hide file tree
Showing 2 changed files with 33 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
22 changes: 22 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,25 @@ Config.EffectInterval = {
timeout = math.random(15000, 20000)
}
}

Config.FuelBlacklist = {
"surge",
"iwagen",
"voltic",
"voltic2",
"raiden",
"cyclone",
"tezeract",
"neon",
"omnisegt",
"iwagen",
"caddy",
"caddy2",
"caddy3",
"airtug",
"rcbandito",
"imorgon",
"dilettante",
"khamelion",
"wheelchair",
}

0 comments on commit db83503

Please sign in to comment.