Skip to content

Commit

Permalink
2.1.2 | Major Fixes, Add New Config Option
Browse files Browse the repository at this point in the history
  • Loading branch information
dnelyk authored May 27, 2023
2 parents 7a95a56 + 2fa2c5f commit c14b7da
Show file tree
Hide file tree
Showing 14 changed files with 731 additions and 338 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
![Codine Development Fuel Script Banner](https://i.imgur.com/qVOMMvW.png)

# _CDN-Fuel (2.1.1)_
# _CDN-Fuel (2.1.2)_

A highly in-depth fuel system for **FiveM** with support for the **QBCore Framework & QBox Remastered**.

# _Lastest Patch Information_
*Additions:*
- Emergency Services Discounts (Config Enabled)
- Air & Water Vehicle Fueling (Config Enabled)
- Hose Attached To Nozzle (Config Enabled)
- OX Library Support (Menu/Input/Inventory/Target) Additions.
- QBox Framework now supported.
- Electric Vehicles turn off when at 0 fuel. (Config Enabled)
- Various Optimizations Throughout
- Config Option for Having Owners Pickup Reserves they Purchase

*Fixes:*
- Bank Payment Double Taxing Payments.
- Paleto Locations PolyZone issue.
- Fix Electric Vehicles Not Stopping On 0 Fuel
- Fix Emergency Services Discounts
- Fix Polyzone for MRPD Helicopter Refuel
- Blip Color on Normal Blip not working.
- [Jerry Can Flipped Orientation](https://github.com/dnelyk/cdn-grub-updates/assets/95599217/0489397e-99c9-43d9-8aab-0d4a45463cfd)
- Various Syphoning Issues (Item Data / Input / Menu etc)
- Various Jerry Can Issues (Similar to Syphon Issues)
- Station Owners Not Recieving Full Price on Discounted Purchases

*Removals:*
- NPWD "Support" as there are various large issues.

<br>
<br>
Expand Down
19 changes: 4 additions & 15 deletions client/electric_cl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if Config.ElectricVehicleCharging then
local money = nil
if purchasetype == "bank" then money = QBCore.Functions.GetPlayerData().money['bank'] elseif purchasetype == 'cash' then money = QBCore.Functions.GetPlayerData().money['cash'] end
FuelPrice = (1 * Config.ElectricChargingPrice)
local vehicle = QBCore.Functions.GetClosestVehicle()
local vehicle = GetClosestVehicle()

-- Police Discount Math --
if Config.EmergencyServicesDiscount['enabled'] == true and (Config.EmergencyServicesDiscount['emergency_vehicles_only'] == false or (Config.EmergencyServicesDiscount['emergency_vehicles_only'] == true and GetVehicleClass(vehicle) == 18)) then
Expand Down Expand Up @@ -205,7 +205,7 @@ if Config.ElectricVehicleCharging then
end)

RegisterNetEvent('cdn-fuel:client:electric:SendMenuToServer', function()
local vehicle = QBCore.Functions.GetClosestVehicle()
local vehicle = GetClosestVehicle()
local vehiclename = GetEntityModel(vehicle)
AwaitingElectricCheck = true
FoundElectricVehicle = false
Expand Down Expand Up @@ -340,7 +340,7 @@ if Config.ElectricVehicleCharging then
if amount < 1 then return end
if amount < 10 then fuelamount = string.sub(amount, 1, 1) else fuelamount = string.sub(amount, 1, 2) end
local FuelPrice = (Config.ElectricChargingPrice * 1)
local vehicle = QBCore.Functions.GetClosestVehicle()
local vehicle = GetClosestVehicle()

-- Police Discount Math --
if Config.EmergencyServicesDiscount['enabled'] == true and (Config.EmergencyServicesDiscount['emergency_vehicles_only'] == false or (Config.EmergencyServicesDiscount['emergency_vehicles_only'] == true and GetVehicleClass(vehicle) == 18)) then
Expand Down Expand Up @@ -394,7 +394,7 @@ if Config.ElectricVehicleCharging then
end

local refillCost = (fuelamount * FuelPrice) + GlobalTax(fuelamount*FuelPrice)
local vehicle = QBCore.Functions.GetClosestVehicle()
local vehicle = GetClosestVehicle()
local ped = PlayerPedId()
local time = amount * Config.RefuelTime
if amount < 10 then time = 10 * Config.RefuelTime end
Expand Down 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
Loading

0 comments on commit c14b7da

Please sign in to comment.