mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
Refactor! (esx_mechanicjob): Breaking - change functions to match legacy
This commit is contained in:
@@ -12,9 +12,9 @@ local function Harvest(source)
|
||||
|
||||
if PlayersHarvesting[source] == true then
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
local GazBottleQuantity = xPlayer.getInventoryItem('gazbottle').count
|
||||
local GazBottle = xPlayer.hasItem('gazbottle')
|
||||
|
||||
if GazBottleQuantity >= 5 then
|
||||
if GazBottle and GazBottle.count >= 5 then
|
||||
TriggerClientEvent('esx:showNotification', source, _U('you_do_not_room'))
|
||||
else
|
||||
xPlayer.addInventoryItem('gazbottle', 1)
|
||||
@@ -44,9 +44,9 @@ local function Harvest2(source)
|
||||
|
||||
if PlayersHarvesting2[source] == true then
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
local FixToolQuantity = xPlayer.getInventoryItem('fixtool').count
|
||||
local FixToolQuantity = xPlayer.hasItem('fixtool')
|
||||
|
||||
if FixToolQuantity >= 5 then
|
||||
if FixToolQuantity and FixToolQuantity.count >= 5 then
|
||||
TriggerClientEvent('esx:showNotification', source, _U('you_do_not_room'))
|
||||
else
|
||||
xPlayer.addInventoryItem('fixtool', 1)
|
||||
@@ -107,9 +107,9 @@ local function Craft(source)
|
||||
|
||||
if PlayersCrafting[source] == true then
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
local GazBottleQuantity = xPlayer.getInventoryItem('gazbottle').count
|
||||
local GazBottleQuantity = xPlayer.hasItem('gazbottle')
|
||||
|
||||
if GazBottleQuantity <= 0 then
|
||||
if not GazBottleQuantity then
|
||||
TriggerClientEvent('esx:showNotification', source, _U('not_enough_gas_can'))
|
||||
else
|
||||
xPlayer.removeInventoryItem('gazbottle', 1)
|
||||
@@ -140,9 +140,9 @@ local function Craft2(source)
|
||||
|
||||
if PlayersCrafting2[source] == true then
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
local FixToolQuantity = xPlayer.getInventoryItem('fixtool').count
|
||||
local FixToolQuantity = xPlayer.hasItem('fixtool')
|
||||
|
||||
if FixToolQuantity <= 0 then
|
||||
if not FixToolQuantity then
|
||||
TriggerClientEvent('esx:showNotification', source, _U('not_enough_repair_tools'))
|
||||
else
|
||||
xPlayer.removeInventoryItem('fixtool', 1)
|
||||
|
||||
Reference in New Issue
Block a user