[RELEASE] [ESX] Business system

Search function: runMoneyCoroutines
and in terms of if business ["owner"] ~ = nil then
add ESX.GetPlayerFromIdentifier (business ["owner"])
should get if business ["owner"] ~ = nil and ESX.GetPlayerFromIdentifier (business ["owner"]) then

I have the script added. I have setup busnesses throughout the city. They have copied to the database, but nothing shows in game. The HUD menu doesnt pop up for people to buy the busnesses.
Any help would be appreciated.

this is somehting I’m looking into as well, we might be able to edit the code?

Maybe learn to read code and errors before starting a server?

Can someone plz help me i started the resource and i have issue because when i open the menu its say only locale

image Why?

It would be a problem for players who have business. offline they also get the money. any solution maybe? Thanks

Sin título
I get invalid locale everytime, in menu, notifications, etc etc. i’m just download the original script without modifications and i get the same… Can i get some help?

someone has a solution

Change in the file configu.lua “en”

Hey i love you script so far.
I just wanna know if there is a way to make the owner a society? That the earnings go to society x and the boss from this society has the permission to buy stocks.
P.S. Sorry for my bad English not my main language

Hi all

is it possible to avoid getting money offline? only if online?

Thanks answears :slight_smile:

So i can get it into the game but when i go to create the business through /business create nothing pops up but i can still write and create the business through guessing the boxs, the business will eventually pop up but i then cannot buy it???

Read the branch was a decision.

I have the exact same problem

Hi all

If you want players not to receive money from the store offline.

how to make to get money every 24 hours

So been doing a lil snooping through the resource and was wondering what i would call to have stocks bought with dirty cash. My thoughts are you buy the business with clean and then clean your cash through the stocks. ive found in the server.lua a call for money just kinda unsure how to call for dirty.

So found the function for adding money via Player bank account but i cant find the function for removing the money.

So looking through esx_moneywash and referencing back to this im a bit confused on what to change and call. Im pretty new to scripting in lua but im getting my legs. lol

Stocks function.

esx_moneywash.

If anyone can help out would be much appreciated.

Fix it in case anyone wants to know how here you go.

Replace lines 69 to 89 with this in the server.lua

ESX.RegisterServerCallback("el_business:buyStock", function(source,cb,business,amt)
        local xPlayer = ESX.GetPlayerFromId(source)
        local identifier = xPlayer.getIdentifier()
        if dataCache[business]["owner"]==identifier or isBusinessEmployee(dataCache[business]["employees"],identifier) then
            if xPlayer.getAccount('black_money').money>=dataCache[business]["stock_price"]*amt then
                xPlayer.removeAccountMoney('black_money', dataCache[business]["stock_price"]*amt)
                local time = math.random(300,900)
                Citizen.CreateThread(function()
                    print("[^1"..GetCurrentResourceName().."^7] Player "..identifier.." bought stock, delivering in: "..time.."s")
                    Citizen.Wait(time*1000)
                    MySQL.Async.execute('UPDATE businesses SET stock = stock + @amt WHERE id = @business', {["@amt"] = tonumber(amt), ["@business"] = tonumber(business)}, nil)
                    TriggerClientEvent('esx:showNotification', source, _L("stock_delivered"):format(dataCache[business]["name"]))
                end)
                cb(true,time)
            else
                cb(false,0)
            end
        else
            cb(false,0)
        end
    end)

Can I do something that others can’t buy but I can give to other people? How do I do this?