[RELEASE] [ESX] Business system

Does this still work on latest versions? If not is there a alternative which does work

can you make availble for qbcore?

Hey, i get an error from esx_menu_default:nui "Uncaught TypeError: Cannot read property ‘scrollIntoView’ of undefined (@esx_menu_default/html/js/app.js:64 (or 239))

i have a fix for that problem

go to the server.lua at line 258

and change this
if xPlayer.getGroup()~=“superadmin” then
to this
if xPlayer.getGroup()~=“admin” then

then you can use the command

So when I create a shop I get “there was an error creating the shop”, how can I fix this?

I’ve got same issue, can someone help? How to fix when a player is not online to get the money as well?

[FIX] [ESX Legacy] Receiving Money if Player is not Online

Replace this function in server.lua to Support ESX 1.2 ; ESX v1-final and ESX Legacy :slight_smile:
Add Config.ForceMoney = true to your config.lua

function addMoney(identifier,money,business)
    if not identifier then return end
    local xPlayer = ESX.GetPlayerFromIdentifier(identifier)
    local money = math.floor(tonumber(money))
    if xPlayer then
        print("[^1"..GetCurrentResourceName().."^7] Adding money to "..GetPlayerName(xPlayer.source).." - "..identifier.." ("..tostring(money).."$)")
        TriggerClientEvent('esx:showNotification', xPlayer.source, _L("received_money"):format(tostring(money),business))
        xPlayer.addAccountMoney("bank", math.floor(money))
    else
        --print("[^1"..GetCurrentResourceName().."^7] An error occured while adding money to "..identifier.." ("..tostring(money).."$). The player is offline.")
        if Config.ForceMoney then
            print("[^1"..GetCurrentResourceName().."^7] Forcing adding money to " .. identifier .. " (" ..tostring(money).. "$). The player is offline.")
            --MySQL.Sync.execute('UPDATE `users` SET `bank` = `bank` + @bank WHERE `identifier` = @identifier',{['@bank'] = money, ['@identifier'] = identifier})
            MySQL.Async.fetchAll('SELECT accounts FROM users WHERE identifier = @identifier', { 
                ["@identifier"] = identifier 
            }, function(result)
                if result[1] then
                    local accs = json.decode(result[1].accounts)
                    
                    accs.bank = accs.bank + money
            
                    MySQL.Async.execute("UPDATE users SET accounts = @bank WHERE identifier = @identifier", {
                        ["@identifier"] = identifier,
                        ["@bank"] = json.encode(accs)
                    })
                end
            end)
        end
    end
end

I tired but still doesn’t work.
Here is the error:

[ script:el_business] [el_business] Running money coroutines 22:1 [ script:el_business] [el_business] An error occured while adding money to 107268d75722ed59ce2ce81d4c6398d001293eee (529$). The player is offline. [ script:el_business] [el_business] Forcing adding money [ script:el_business] [el_business] An error occured while adding money to e8a5f1a582ce2459f3e47ac9059bde2dd290c7ed (794$). The player is offline. [ script:el_business] [el_business] Forcing adding money [ script:el_business] [el_business] An error occured while adding money to f0dc0d1da93c40b697a5f5aeb172f9fc0027339f (40000$). The player is offline. [ script:el_business] [el_business] Forcing adding money [ script:el_business] [el_business] An error occured while adding money to e8a5f1a582ce2459f3e47ac9059bde2dd290c7ed (60000$). The player is offline.

I can’t see any error in your print :smiley:

any solution?

I get an insufficient permission error any idea what that could be?