## lesimo.tebex.io ##
Thanks for purchasing this script. For support join my discord and open ticket
https://discord.gg/8e56sZGFQN

## Dependencies
np-actionbar (Real 3.0)
np-binds Real (3.0)
np-propattach Real (3.0)
np-target Real (3.0)
np-taskbar
np-taskbarskill
np-weapons Real (3.0)
damage-events Real (3.0)
PolyZone (Credit : mkafrin)

## es_extended version
es_extended v1final

## SQL
1. Run the SQL

## Note
You can add shops and stashes from np-inventory/config.lua
About shops
You need to change its shopnumber section from config.
Default Shop number list
2 - Normal shop
4 - Hardware Store
5 - Gun store
10 - Police armory
12 - Burger store
18 - Taco store 
22 - Jail store
27 - Mechanic
28 - Blackmarket

If you want to add new shop type open ticket for detailed info.

## Required Changes
Change ghmattimysql config (Replace database string with your database name)

## Replace This Code :

## es_extended: (es_extended/server/main.lua)

     xPlayer.triggerEvent('esx:createMissingPickups', ESX.Pickups)
     xPlayer.triggerEvent('esx:registerSuggestions', ESX.RegisteredCommands)

## With :

     xPlayer.triggerEvent('esx:setmoneyinfo', xPlayer.getMoney())

     xPlayer.triggerEvent('esx:createMissingPickups', ESX.Pickups)
     xPlayer.triggerEvent('esx:registerSuggestions', ESX.RegisteredCommands)

## es_extended: (es_extended/server/player.lua)

     self.setAccountMoney = function(accountName, money)
        if money >= 0 then
            local account = self.getAccount(accountName)

            if account then
                local prevMoney = account.money
                local newMoney = ESX.Math.Round(money)
                account.money = newMoney

                self.triggerEvent('esx:setAccountMoney', account)
                
            end
        end
    end

    self.addAccountMoney = function(accountName, money)
        if money > 0 then
            local account = self.getAccount(accountName)

            if account then
                local newMoney = account.money + ESX.Math.Round(money)
                account.money = newMoney

                self.triggerEvent('esx:setAccountMoney', account)

                
            end
        end
    end

    self.removeAccountMoney = function(accountName, money)
        if money > 0 then
            local account = self.getAccount(accountName)

            if account then
                local newMoney = account.money - ESX.Math.Round(money)
                account.money = newMoney

                self.triggerEvent('esx:setAccountMoney', account)
                
            end
        end
    end

## With :

	self.setAccountMoney = function(accountName, money)
        if money >= 0 then
            local account = self.getAccount(accountName)

            if account then
                local prevMoney = account.money
                local newMoney = ESX.Math.Round(money)
                account.money = newMoney

                self.triggerEvent('esx:setAccountMoney', account)
                if accountName == "money" then
                    self.triggerEvent('esx:setmoneyinfo', account.money)
                end
            end
        end
    end

    self.addAccountMoney = function(accountName, money)
        if money > 0 then
            local account = self.getAccount(accountName)

            if account then
                local newMoney = account.money + ESX.Math.Round(money)
                account.money = newMoney

                self.triggerEvent('esx:setAccountMoney', account)

                if accountName == "money" then
                    self.triggerEvent('esx:setmoneyinfo', account.money)
                end
            end
        end
    end

    self.removeAccountMoney = function(accountName, money)
        if money > 0 then
            local account = self.getAccount(accountName)

            if account then
                local newMoney = account.money - ESX.Math.Round(money)
                account.money = newMoney

                self.triggerEvent('esx:setAccountMoney', account)
                if accountName == "money" then
                    self.triggerEvent('esx:setmoneyinfo', account.money)
                end
            end
        end
    end

## es_extended: (es_extended/server/commands.lua)

    ESX.RegisterCommand('giveitem', 'admin', function(xPlayer, args, showError)
	    args.playerId.addInventoryItem(args.item, args.count)
    end, true, {help = _U('command_giveitem'), validate = true, arguments = {
	    {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'},
	    {name = 'item', help = _U('command_giveitem_item'), type = 'item'},
	    {name = 'count', help = _U('command_giveitem_count'), type = 'number'}
    }})
	
## With :	
    
	ESX.RegisterCommand('giveitem', 'admin', function(xPlayer, args, showError)
	    args.playerId.triggerEvent("player:receiveItem",args.item,args.count)
    end, true, {help = _U('command_giveitem'), validate = true, arguments = {
	    {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'},
	    {name = 'item', help = _U('command_giveitem_item'), type = 'item'},
	    {name = 'count', help = _U('command_giveitem_count'), type = 'number'}
    }})
	