ESX V11
if you are going to do this make sure that all players have a cash value of 0, if players have a cash value higher than 0 set them all to 0
Open es_extended/server/classes /player.lua file
Find self.setAccountMoney() function
Replace the function with the following
function self.setAccountMoney(accountName, money, reason, forInventory)
reason = reason or "unknown"
if not tonumber(money) then
print(("[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
return
end
if money >= 0 then
local account = self.getAccount(accountName)
if account then
money = account.round and ESX.Math.Round(money) or money
self.accounts[account.index].money = money
if not forInventory then
local isMoneyItem, moneyItemName = exports["tgiann-inventory"]:IsMoneyItem(accountName)
if isMoneyItem then
exports["tgiann-inventory"]:SetItem(self.source, moneyItemName, money)
end
end
self.triggerEvent("esx:setAccountMoney", account)
_TriggerEvent("esx:setAccountMoney", self.source, accountName, money, reason)
else
print(("[^1ERROR^7] Tried To Set Invalid Account ^5%s^0 For Player ^5%s^0!"):format(accountName, self.playerId))
end
else
print(("[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7"):format(accountName, self.playerId, money))
end
endFind self.addAccountMoney() function
Replace the function with the following
Find self.removeAccountMoney() function
Replace the function with the following
Add the following item to the itemlist
Last updated