ESX V12

  1. Open es_extended/server/classes /player.lua file

  2. Find self.setAccountMoney() function

  3. Replace the function with the following

function self.setAccountMoney(accountName, money, reason, forInventory)
reason = reason or "unknown"
    if not tonumber(money) then
        error(("Tried To Set Account ^5%s^1 For Player ^5%s^1 To An Invalid Number -> ^5%s^1"):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
            error(("Tried To Set Invalid Account ^5%s^1 For Player ^5%s^1!"):format(accountName, self.playerId))
        end
    else
        error(("Tried To Set Account ^5%s^1 For Player ^5%s^1 To An Invalid Number -> ^5%s^1"):format(accountName, self.playerId, money))
    end
end
  1. Find self.addAccountMoney() function

  2. Replace the function with the following

  1. Find self.removeAccountMoney() function

  2. Replace the function with the following

  1. Add the following item to the itemlist

Last updated