From aad435842bb86e525fc094b8144846321b3c4b15 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 27 Dec 2019 13:47:18 +0100 Subject: [PATCH] Update player.lua --- server/classes/player.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server/classes/player.lua b/server/classes/player.lua index 617c04af..002d2850 100644 --- a/server/classes/player.lua +++ b/server/classes/player.lua @@ -271,13 +271,13 @@ function CreateExtendedPlayer(player, accounts, inventory, job, loadout, name, l if account then local prevMoney = account.money local newMoney = ESX.Math.Round(money) - + account.money = newMoney - + if acc == 'bank' then self.set('bank', newMoney) end - + TriggerClientEvent('esx:setAccountMoney', self.source, account) end end @@ -293,11 +293,11 @@ function CreateExtendedPlayer(player, accounts, inventory, job, loadout, name, l if account then local newMoney = account.money + ESX.Math.Round(money) account.money = newMoney - + if acc == 'bank' then self.set('bank', newMoney) end - + TriggerClientEvent('esx:setAccountMoney', self.source, account) end end @@ -313,11 +313,11 @@ function CreateExtendedPlayer(player, accounts, inventory, job, loadout, name, l if account then local newMoney = account.money - ESX.Math.Round(money) account.money = newMoney - + if acc == 'bank' then self.set('bank', newMoney) end - + TriggerClientEvent('esx:setAccountMoney', self.source, account) end end @@ -338,7 +338,7 @@ function CreateExtendedPlayer(player, accounts, inventory, job, loadout, name, l if item then local newCount = item.count + count item.count = newCount - + TriggerEvent('esx:onAddInventoryItem', self.source, item, count) TriggerClientEvent('esx:addInventoryItem', self.source, item, count) end @@ -352,7 +352,7 @@ function CreateExtendedPlayer(player, accounts, inventory, job, loadout, name, l if newCount >= 0 then item.count = newCount - + TriggerEvent('esx:onRemoveInventoryItem', self.source, item, count) TriggerClientEvent('esx:removeInventoryItem', self.source, item, count) end @@ -365,7 +365,7 @@ function CreateExtendedPlayer(player, accounts, inventory, job, loadout, name, l if item and count >= 0 then local oldCount = item.count item.count = count - + if oldCount > item.count then TriggerEvent('esx:onRemoveInventoryItem', self.source, item, oldCount - item.count) TriggerClientEvent('esx:removeInventoryItem', self.source, item, oldCount - item.count) @@ -514,7 +514,7 @@ function CreateExtendedPlayer(player, accounts, inventory, job, loadout, name, l break end end - + TriggerClientEvent('esx:removeWeaponComponent', self.source, weaponName, weaponComponent) end end @@ -537,7 +537,7 @@ function CreateExtendedPlayer(player, accounts, inventory, job, loadout, name, l return true end end - + return false else return false