Skip to content

Commit

Permalink
Patch: Fix Exploit with Syphoning; Fix issue with slow database conne…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
dnelyk committed Apr 15, 2023
1 parent 8e09e76 commit 7a95a56
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions client/fuel_cl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ RegisterNetEvent('cdn-fuel:client:FinalMenu', function(purchasetype)
end
if RefuelingType == nil then
FetchStationInfo("all")
Wait(100)
if Config.PlayerOwnedGasStationsEnabled and not Config.UnlimitedFuel then
Wait(Config.WaitTime)
if Config.PlayerOwnedGasStationsEnabled and not Config.UnlimitedFuel then
if ReserveLevels < 1 then
QBCore.Functions.Notify(Lang:t("station_no_fuel"), 'error', 7500) return
end
Expand Down Expand Up @@ -1838,12 +1838,16 @@ RegisterNetEvent('cdn-syphoning:syphon', function(data)
},
}) then
StopAnimTask(PlayerPedId(), Config.StealAnimDict, Config.StealAnim, 1.0)
PoliceAlert(GetEntityCoords(PlayerPedId()))
QBCore.Functions.Notify(Lang:t("syphon_success"), 'success')
SetFuel(vehicle, removeamount)
local syphonData = data.itemData
local srcPlayerData = QBCore.Functions.GetPlayerData()
TriggerServerEvent('cdn-fuel:info', "add", tonumber(syphonAmount), srcPlayerData, syphonData)
if GetFuel(vehicle) >= syphonAmount then
PoliceAlert(GetEntityCoords(PlayerPedId()))
QBCore.Functions.Notify(Lang:t("syphon_success"), 'success')
SetFuel(vehicle, removeamount)
local syphonData = data.itemData
local srcPlayerData = QBCore.Functions.GetPlayerData()
TriggerServerEvent('cdn-fuel:info', "add", tonumber(syphonAmount), srcPlayerData, syphonData)
else
QBCore.Functions.Notify(Lang:t("menu_syphon_vehicle_empty"), 'error')
end
else
PoliceAlert(GetEntityCoords(PlayerPedId()))
StopAnimTask(PlayerPedId(), Config.StealAnimDict, Config.StealAnim, 1.0)
Expand Down Expand Up @@ -1884,13 +1888,16 @@ RegisterNetEvent('cdn-syphoning:syphon', function(data)
anim = Config.StealAnim,
flags = 1,
}, {}, {}, function() -- Play When Done
StopAnimTask(PlayerPedId(), Config.StealAnimDict, Config.StealAnim, 1.0)
PoliceAlert(GetEntityCoords(PlayerPedId()))
QBCore.Functions.Notify(Lang:t("syphon_success"), 'success')
SetFuel(vehicle, removeamount)
local syphonData = data.itemData
local srcPlayerData = QBCore.Functions.GetPlayerData()
TriggerServerEvent('cdn-fuel:info', "add", tonumber(syphon.amount), srcPlayerData, syphonData)
if GetFuel(vehicle) >= syphonAmount then
PoliceAlert(GetEntityCoords(PlayerPedId()))
QBCore.Functions.Notify(Lang:t("syphon_success"), 'success')
SetFuel(vehicle, removeamount)
local syphonData = data.itemData
local srcPlayerData = QBCore.Functions.GetPlayerData()
TriggerServerEvent('cdn-fuel:info', "add", tonumber(syphonAmount), srcPlayerData, syphonData)
else
QBCore.Functions.Notify(Lang:t("menu_syphon_vehicle_empty"), 'error')
end
end, function() -- Play When Cancel
PoliceAlert(GetEntityCoords(PlayerPedId()))
StopAnimTask(PlayerPedId(), Config.StealAnimDict, Config.StealAnim, 1.0)
Expand Down

0 comments on commit 7a95a56

Please sign in to comment.