[RELEASE] [ESX] Business system

Works great for me. Everyone needs to remember to /setadmin id 10 for this to work (even if you’re a superadmin). I think having anyone be able to buy stocks would really make it interesting. Values of companies can rise and fall, people can make money on the side by investing, etc. Keep up the good work!

1 Like

Hi! Cool script but how i can remove a business? XD

1 Like

I have created the shops, but only 1 appears

1 Like

you need to do that manually from the database

1 Like

Another feature to add (along with a script for /business list) :wink:

Will you accept a PR?

1 Like

found the issue, will fix it soon

1 Like

what do you mean?
the script already has a /business list command if you mean that
image

1 Like

okey thx, and other issue im having is that i dont recive the money

1 Like

did you restart the script at any point? are there any errors when the money coroutines run?

1 Like

i tried to restart it, but in the console it said that the script didnt exist

1 Like

Rather than having people go to F8 to see the list have a UI (like esx_scoreboard or something). Also for me the list doesn’t wrap so it just shows a single line.

2 Likes

yeah, i fixed that but it used to be in separate lines but it broke along the way somehow

1 Like

you can’t restart only the script, you have to restart the whole server
there’s even a nice warning when you start/restart the scritpt

1 Like

and what about the money?

1 Like

any errors in the server console, if yes, screenshot it

1 Like

no errors

1 Like

i messaged you in private so i can help you better

1 Like

Hello. Ive changed cron to do job every 15 minutes but it doing it in random… sometimes an hour sometimes half hour.

for i=0,23 do
TriggerEvent(“cron:runAt”,i,15,runMoneyCoroutines)
end

if i change this like
TriggerEvent(“cron:runAt”,0,0,15,runMoneyCoroutines)
it should run every 15 minutes?

2 Likes

Thats not every 15 minutes.

Thats 15 past every hour.

2 Likes

if you want it to run every 15 minutes you can do this

for i=0,23 do
    for j=0,60,15 do
        TriggerEvent(“cron:runAt”,i,j,runMoneyCoroutines)
    end
end

or if you don’t care if it fires exactly at :00 :15 :30 and :45 then you can just do a tick loop

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(15*60*1000)
        runMoneyCoroutines()
    end
end)
1 Like