Business system for FiveM (ESX)
Buy a business, order stock and get money every irl hour!
You can have employees, which get a cut from the income based on a formula that can be edited in the config. They can also buy stock for you (with their own money).
- Download the resource
- Put it into your resources folder
- Import sql.sql into your database
- Edit the config to your liking
- Add
start el_business
to your server.cfg Make sure to add this after mysql-async and es_extended - Start it and you're good to go
Commands:
- /business <- root admin command, shows possible sub-commands - make sure you have superadmin
- /business create <- admin command, allows you to create a business in your current location
- /business list <- admin command, dumps list of current businesses into your console
- /business reload <- admin command, reloads business data from database
If you want to change your locale from en
to some of the pre-made ones, here's how to do it
- Change locale in config.lua to the desired one
- Change line 6 and 12 in __resource.lua your locale's filename (for example
locale/sk.lua
) - Start it and it should work (if not, restart your server)
Translators:
@Elipse458 - SK (Slovak), CZ (Czech)
@NiT34ByTe - IT (Italian), RO (Romanian)
@NessFrg - BR (Brazilian)
@iSiKoZ - FR (French)
@CuPi - PL (Polish)
@Marfru - ES (Spanish)
If you want to submit your own translation, make a pull request or shoot me a DM on discord!
DO NOT RESTART THIS - it requires a full server restart!
If you want to change the time when people receive money (default is every hour at :00) here's how you do it:
- Open
server.lua
and go to line 299 - Change the '0' in
TriggerEvent("cron:runAt",i, *0* ,runMoneyCoroutines)
to a number between 0-59, that will be the minute when it gets executed
If you want to change the hours, i'll let you figure that out on your own as an exercise lol (cron) - If the script doesn't give money to the player, try changing line 194 in server.lua to
xPlayer.addMoney(math.floor(money))
If you have someone in the businesses set as an owner of a business and their identifier is no longer in the users database, you need to set the owner of that business back to NULL. Here's a sql query that can do all of that automagically (might take longer with big users table)
UPDATE businesses SET owner=NULL WHERE owner IS NOT NULL AND NOT EXISTS (SELECT 1 FROM users WHERE businesses.owner = users.identifier)
If find any bugs, please join my discord server and report it in the #bug-reports channel
If you like my work, please check out my page, i'll probably release a few more things if i have the time and feel like it