Skip to content

Commit

Permalink
feat(Fix: Syphoning Issues | Remove: NPWD "Support" as there are issu…
Browse files Browse the repository at this point in the history
…es with it.)
  • Loading branch information
dnelyk committed May 26, 2023
1 parent 52b91d8 commit 11a21be
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 87 deletions.
11 changes: 0 additions & 11 deletions client/electric_cl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -461,17 +461,6 @@ if Config.ElectricVehicleCharging then
if purchasetype == "cash" then
TriggerServerEvent('cdn-fuel:server:PayForFuel', refillCost, purchasetype, FuelPrice, true)
elseif purchasetype == "bank" then
if Config.NPWD then
exports["npwd"]:createNotification({ -- You can change this export to your own notification
notisId = "npwd:electricityPaidFor",
appId = "BANK",
content = "You have paid $"..refillCost.." for electric at $"..FuelPrice.." per KWh + tax",
secondaryTitle = "New Transaction",
keepOpen = false,
duration = 15000,
path = "/BANK",
})
end
TriggerServerEvent('cdn-fuel:server:PayForFuel', refillCost, purchasetype, FuelPrice, true)
end
local curfuel = GetFuel(vehicle)
Expand Down
27 changes: 3 additions & 24 deletions client/fuel_cl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1083,17 +1083,6 @@ RegisterNetEvent('cdn-fuel:client:RefuelVehicle', function(data)
if purchasetype == "cash" then
TriggerServerEvent('cdn-fuel:server:PayForFuel', refillCost, purchasetype, FuelPrice, false, CachedFuelPrice)
elseif purchasetype == "bank" then
if Config.NPWD then
exports["npwd"]:createNotification({ -- You can change this export to your own notification
notisId = "npwd:fuelPaidFor",
appId = "BANK",
content = "You have paid $"..refillCost.." for fuel at $"..FuelPrice.." Per Liter + tax",
secondaryTitle = "New Transaction",
keepOpen = false,
duration = 15000,
path = "/BANK",
})
end
if not Config.RenewedPhonePayment or purchasetype == "cash" then
TriggerServerEvent('cdn-fuel:server:PayForFuel', refillCost, purchasetype, FuelPrice, false, CachedFuelPrice)
end
Expand Down Expand Up @@ -1330,17 +1319,6 @@ RegisterNetEvent('cdn-fuel:client:jerrycanfinalmenu', function(purchasetype)
Moneyamount = QBCore.Functions.GetPlayerData().money['cash']
end
if Moneyamount > math.ceil(Config.JerryCanPrice + GlobalTax(Config.JerryCanPrice)) then
if purchasetype == 'bank' and Config.NPWD then
exports["npwd"]:createNotification({ -- You can change this export to your own notification
notisId = "npwd:JerryCanBought",
appId = "BANK",
content = "You have paid $"..math.ceil(Config.JerryCanPrice + GlobalTax(Config.JerryCanPrice)).." for a jerry can",
secondaryTitle = "New Transaction",
keepOpen = false,
duration = 15000,
path = "/BANK",
})
end
TriggerServerEvent('cdn-fuel:server:purchase:jerrycan', purchasetype)
else
if purchasetype == 'bank' then QBCore.Functions.Notify(Lang:t("not_enough_money_in_bank"), 'error') end
Expand Down Expand Up @@ -1934,13 +1912,14 @@ RegisterNetEvent('cdn-syphoning:syphon', function(data)
anim = Config.StealAnim,
flags = 1,
}, {}, {}, function() -- Play When Done
if GetFuel(vehicle) >= syphonAmount then
if GetFuel(vehicle) >= tonumber(syphon.amount) 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)
TriggerServerEvent('cdn-fuel:info', "add", tonumber(syphon.amount), srcPlayerData, syphonData)
StopAnimTask(PlayerPedId(), Config.StealAnimDict, Config.StealAnim, 1.0)
else
QBCore.Functions.Notify(Lang:t("menu_syphon_vehicle_empty"), 'error')
end
Expand Down
50 changes: 0 additions & 50 deletions client/station_cl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1183,56 +1183,6 @@ if Config.PlayerOwnedGasStationsEnabled then -- This is so Player Owned Gas Stat
end
end)

if Config.NPWD then
RegisterNetEvent('cdn-fuel:client:buysellStationNPWDNotif', function(type, totalcost, location)
if type == "buy" then
exports["npwd"]:createNotification({ -- You can change this export to your own notification
notisId = "npwd:stationPaidFor",
appId = "BANK",
content = "You have paid $"..totalcost.." for " .. location,
secondaryTitle = "New Transaction",
keepOpen = false,
duration = 15000,
path = "/BANK",
})
elseif type == "sell" then
exports["npwd"]:createNotification({ -- You can change this export to your own notification
notisId = "npwd:stationSell",
appId = "BANK",
content = "You have recieved $"..totalcost.." for selling " .. location,
secondaryTitle = "New Transaction",
keepOpen = false,
duration = 15000,
path = "/BANK",
})
end
end)

RegisterNetEvent('cdn-fuel:client:StationTransfersNPWDNotif', function(type, totalcost, location)
if type == "deposit" then
exports["npwd"]:createNotification({ -- You can change this export to your own notification
notisId = "npwd:stationDeposit",
appId = "BANK",
content = "You have depositted $"..totalcost.." into " .. location,
secondaryTitle = "Deposit Transaction",
keepOpen = false,
duration = 15000,
path = "/BANK",
})
elseif type == "withdraw" then
exports["npwd"]:createNotification({ -- You can change this export to your own notification
notisId = "npwd:stationWithdraw",
appId = "BANK",
content = "You have withdrawn $"..totalcost.." from " .. location,
secondaryTitle = "Withdraw Transaction",
keepOpen = false,
duration = 15000,
path = "/BANK",
})
end
end)
end -- Config.NPWD

-- Threads
CreateThread(function() -- Spawn the Peds for Gas Stations when the resource starts.
SpawnGasStationPeds()
Expand Down
3 changes: 1 addition & 2 deletions shared/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Config.ShowNearestGasStationOnly = true -- When enabled, only the nearest gas st
Config.LeaveEngineRunning = true -- When true, the vehicle's engine will be left running upon exit if the player *HOLDS* F.
Config.VehicleBlowUp = true -- When true, there will be a configurable chance of the vehicle blowing up, if you fuel while the engine is on.
Config.BlowUpChance = 5 -- Percentage for Chance of Engine Explosion (Default: 5% or 5)
Config.CostMultiplier = 3.0 -- Amount to multiply 1 by. This indicates fuel price. (Default: $3.0/l or 3.0)
Config.CostMultiplier = 3 -- Amount to multiply 1 by. This indicates fuel price. (Default: $3.0/l or 3.0)
Config.GlobalTax = 15.0 -- The tax, in %, that people will be charged at the pump. (Default: 15% or 15.0)
Config.FuelNozzleExplosion = false -- When true, it enables the fuel pump exploding when players run away with the nozzle. Highly recommeded to be false.
Config.FuelDecor = "_FUEL_LEVEL" -- Do not touch! (Default: "_FUEL_LEVEL")
Expand Down Expand Up @@ -54,7 +54,6 @@ Config.VehicleShutoffOnLowFuel = { -- If enabled, vehicles will turn off when th

-- Phone --
Config.RenewedPhonePayment = false -- Enables use of Renewed-Phone Payment System and Notifications
Config.NPWD = false -- Enables phone notifications for New-Phone-Who-Dis.

-- Syphoning --
Config.UseSyphoning = false -- Follow the Syphoning Install Guide to enable this option!
Expand Down

0 comments on commit 11a21be

Please sign in to comment.