Installation

Enhance your FiveM server with our business system script, where business opportunities come to life!

Step 1

Make sure you have on your server all the scripts written in dependencies

Step 2

Once your purchase is verified, download the resource and add it to the resources of your server. Then add this line of code to your server.cfg

ensure fo4rUtils
ensure fo4rBusiness

Step 3

Inside the resource you will find a file called "inventario.lua" where you can change the configuration depending on the inventory you use.

CreateThread(function()
    while GetResourceState('ox_inventory') ~= 'started' do Wait(1000) end
    for k,v in pairs(Cfg.Negocios) do
        local stashpersonal = {
            id = v.job..'locker'..k,
            label = v.label..' Locker',
            owner = true,
            slots = 80,
            weight = 500000,
        }
        exports.ox_inventory:RegisterStash(stashpersonal.id, stashpersonal.label, stashpersonal.slots, stashpersonal.weight, stashpersonal.owner)
        local stash = {
            id = v.job..'inventory'..k,
            label = v.label..' Inventario',
            slots = 140,
            weight = 1000000, 
        }
        exports.ox_inventory:RegisterStash(stash.id, stash.label, stash.slots, stash.weight)
    end
end)

Step 4

Once you make sure to link your inventory in the script you can configure the script to your liking

ESX = exports['es_extended']:getSharedObject()
Cfg = {} or Cfg


Cfg.Locales = {
    ['not_has'] = 'No tienes suficiente',
}

Cfg.Negocios = {
    ['UwU'] = {
        label = 'UwU Cafe',
        job = 'police',
        lockers = {
            { coords = vec3(-1137.2706, 4291.5786, 85.9703), dist = 1.5, floating = '[E] | Abrir', type = 'personal'},
            { coords = vec3(-1146.4281, 4289.2813, 84.3507), dist = 1.5, floating = '[E] | Abrir', type = 'job'},
            --add more
        },
        blip = {
            coords = vec3(-1145.1615, 4283.4312, 85.4910),
            sprite = 58,
            color = 2,
            size = 0.8,
        },
        Menus = {
            {
                label = 'Preparar 1',
                floating = '[E] | Preparar 1',
                coords = vec3(-1145.1615, 4283.4312, 85.4910),
                key = 38,
                dist = 1.5,
                anim = 'bbq', -- [EXAMPLE] || /e bbq
                progressBar = {
                    label = 'Preparando Algo',
                    time = 1000,
                },
                elements = {
                    {label = 'Agua de jamon 1', item = 'bread', needs = {
                        {item = 'bread', count = 1},
                        {item = 'water', count = 1},
                    }, cantidad = 1},
                    {label = 'Agua de jamon 2', item = 'bread', needs = {
                        {item = 'bread', count = 1},
                        {item = 'water', count = 1},
                    }, cantidad = 1},
                    {label = 'Agua de jamon 3', item = 'bread', needs = {
                        {item = 'water', count = 1},
                        {item = 'bread', count = 1},
                    }, cantidad = 1},
                    {label = 'Agua de jamon 4', item = 'bread', needs = {
                        {item = 'water', count = 1},
                        {item = 'bread', count = 1},
                    }, cantidad = 1},
                }
            },
            {
                label = 'Preparar 2',
                floating = '[E] | Preparar 2',
                coords = vec3(-1126.1423, 4296.6284, 88.7861),
                dist = 1.5,
                key = 38,
                anim = 'bbq', -- [EXAMPLE] || /e bbq
                progressBar = {
                    label = 'Preparando Algo',
                    time = 1000,
                },
                elements = {
                    {label = 'Agua de jamon', item = 'aguadejamon', needs = {
                        {item = 'water', count = 2},
                        {item = 'jamon', count = 2},
                    }, cantidad = 1},
                    {label = 'Agua de jamon', item = 'aguadejamon', needs = {
                        {item = 'water', count = 2},
                        {item = 'jamon', count = 2},
                    }, cantidad = 1},
                    {label = 'Agua de jamon', item = 'aguadejamon', needs = {
                        {item = 'water', count = 2},
                        {item = 'jamon', count = 2},
                    }, cantidad = 1},
                    {label = 'Agua de jamon', item = 'aguadejamon', needs = {
                        {item = 'water', count = 2},
                        {item = 'jamon', count = 2},
                    }, cantidad = 1},
                }
            },
            -- add more
        }
    },
}   


function Notify(msg, type)
    ESX.ShowNotification(msg, type)
end

function Floating(msg, coords)
    ESX.ShowFloatingHelpNotification(msg, coords)
end

function progressBar(label, time, cb)
    if lib.progressCircle({
        duration = time,
        position = 'bottom',
        label = label,
        useWhileDedad = false,
        canCancel = true,
        disable = {
            move = true
        },
    }) then cb(true) else cb(false) end
end

function openLocker(job, typex)
    if typex == "job" then
        exports.ox_inventory:openInventory('stash', { id = job..'locker', owner = ESX.GetPlayerData().identifier })
    elseif typex == "personal" then
        exports.ox_inventory:openInventory("stash", job..'inventory')
    end
end

Step 5

Turn on your server and enjoy

Last updated