Skip to content

Commit

Permalink
feat(Fix for OX_Inventory Jerry Can)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnelyk committed Aug 11, 2023
1 parent b9b1a70 commit 835161a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
3 changes: 0 additions & 3 deletions client/electric_cl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -679,9 +679,6 @@ if Config.ElectricVehicleCharging then
RequestModel('electric_charger')
while not HasModelLoaded('electric_charger') do
Wait(50)
if Config.FuelDebug then
print("Loading Electric Charger Model.")
end
end
Config.GasStations[i].electriccharger = CreateObject('electric_charger', Config.GasStations[i].electricchargercoords.x, Config.GasStations[i].electricchargercoords.y, Config.GasStations[i].electricchargercoords.z, false, true, true)
if Config.FuelDebug then print("Created Electric Charger @ Location #"..i) end
Expand Down
7 changes: 4 additions & 3 deletions client/fuel_cl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ RegisterNetEvent('cdn-fuel:jerrycan:refueljerrycan', function(data)
QBCore.Functions.Notify(Lang:t("jerry_can_success"), 'success')
local srcPlayerData = QBCore.Functions.GetPlayerData()
if Config.Ox.Inventory then
TriggerServerEvent('cdn-fuel:info', "add", tonumber(refuelAmount), srcPlayerData, 'jerrycan')
TriggerServerEvent('cdn-fuel:info', "add", tonumber(refuelAmount), srcPlayerData, itemData)
else
TriggerServerEvent('cdn-fuel:info', "add", tonumber(refuelAmount), srcPlayerData, itemData)
end
Expand Down Expand Up @@ -1704,7 +1704,7 @@ RegisterNetEvent('cdn-fuel:jerrycan:refueljerrycan', function(data)
local srcPlayerData = QBCore.Functions.GetPlayerData()
local refuelAmount = tonumber(refuel.amount)
if Config.Ox.Inventory then
TriggerServerEvent('cdn-fuel:info', "add", tonumber(refuelAmount), srcPlayerData, 'jerrycan')
TriggerServerEvent('cdn-fuel:info', "add", tonumber(refuelAmount), srcPlayerData, jerryCanData)
else
TriggerServerEvent('cdn-fuel:info', "add", tonumber(refuelAmount), srcPlayerData, jerryCanData)
end
Expand Down Expand Up @@ -1783,6 +1783,7 @@ RegisterNetEvent('cdn-syphoning:syphon:menu', function(itemData)
if tonumber(itemData.metadata.cdn_fuel) < 1 then nogas = true Nogasstring = Lang:t("menu_syphon_empty") else nogas = false Nogasstring = Lang:t("menu_syphon_refuel") end
if tonumber(itemData.metadata.cdn_fuel) == Config.SyphonKitCap then syphonfull = true Stealfuelstring = Lang:t("menu_syphon_kit_full") elseif GetFuel(vehicle) < 1 then syphonfull = true Stealfuelstring = Lang:t("menu_syphon_vehicle_empty") else syphonfull = false Stealfuelstring = Lang:t("menu_syphon_allowed") end -- Disable Options based on item data
else
if not itemData.info.gasamount then nogas = true Nogasstring = Lang:t("menu_syphon_empty") end
if itemData.info.gasamount < 1 then nogas = true Nogasstring = Lang:t("menu_syphon_empty") else nogas = false Nogasstring = Lang:t("menu_syphon_refuel") end
if itemData.info.gasamount == Config.SyphonKitCap then syphonfull = true Stealfuelstring = Lang:t("menu_syphon_kit_full") elseif GetFuel(vehicle) < 1 then syphonfull = true Stealfuelstring = Lang:t("menu_syphon_vehicle_empty") else syphonfull = false Stealfuelstring = Lang:t("menu_syphon_allowed") end -- Disable Options based on item data
end
Expand Down Expand Up @@ -1896,7 +1897,7 @@ RegisterNetEvent('cdn-syphoning:syphon', function(data)
currentsyphonamount = tonumber(data.itemData.metadata.cdn_fuel)
HasSyphon = exports.ox_inventory:Search('count', 'syphoningkit')
else
currentsyphonamount = data.itemData.info.gasamount
currentsyphonamount = data.itemData.info.gasamount or 0
HasSyphon = QBCore.Functions.HasItem("syphoningkit", 1)
end

Expand Down
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fx_version 'cerulean'
game 'gta5'
author 'https://www.github.com/CodineDev' -- Base Refueling System: (https://github.com/InZidiuZ/LegacyFuel), other code by Codine (https://www.github.com/CodineDev).
description 'cdn-fuel'
version '2.1.4'
version '2.1.6'

client_scripts {
'@PolyZone/client.lua',
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.5
2.1.6

0 comments on commit 835161a

Please sign in to comment.