[RELEASE] [ESX] Business system

Unfortunately I have had this error since the last FiveM update:

[ERROR] [MySQL] [el_business] An error happens on MySQL for query “SELECT name,firstname,lastname FROM users WHERE identifier = ‘license:10574d65a88aed4f42ba31cf75990fd41f283a10’”: ER_BAD_FIELD_ERROR: Unknown column ‘name’ in ‘field list’
SCRIPT ERROR: @el_business/server.lua:12: attempt to index a nil value

callback (@el_business/server.lua:99)
fn (@mysql-async/lib/MySQL.lua:197)

thats due to esx update and if you check the github issues, it has already been reported i just dont have the time rn to fix it

Updated!
Changelog:

  • Added version checking
  • Compatibility with new ESX versions
  • Removed owner steam name (thanks new ESX)
  • Minor cosmetic edits to business actions
    All business owners may be fucked thanks to esx changing identifiers
    Database update required: no
    Config update required: no, not really

I recommend not updating if you’re running ESX version <= 1.1.0

Updated!
Changelog:

  • Added max businesses per player
  • Confirmed functionality with older ESX versions
    Database update required: no
    Config update required: yes
2 Likes

Hello, would it be possible to buy the company with black money?

adding money offline doesnt work with the newest es exteneded

Hi there, does anyone know how you seperate the buy and actions blips. They seam to be connected, for our server we would like to lock away the businesses behind a door in one location but have the actions at the business its self. Any help on the matter would be great.

Citizen.CreateThread(function() – draw thread
while true do
Citizen.Wait(5)
local ppos = GetEntityCoords(GetPlayerPed(-1))
for _,business in pairs(businessData) do
local x,y,z = business.position.buy.x,business.position.buy.y,business.position.buy.z
if GetDistanceBetweenCoords(ppos,x,y,z,false)<Config.draw_distance then
for k,v in ipairs(Config.display) do
DrawText3D(x,y,z+0.5+v.offset,business.display[k],v.scale)
end
if business.owner==nil then
DrawMarker(29, x, y, z-0.7, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, 1.2001, 0, 255, 0, 200, 0, 0, 0, true)
elseif business.owner==PlayerData.identifier or business.isemployee then
local xx,yy,zz = business.position.actions.x,business.position.actions.y,business.position.actions.z
DrawMarker(1, xx, yy, zz-1.0, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, 0.25, 0, 0, 255, 100, 0, 0, 0, false)
end
end
end
end
end)

I know it has something to do with this. Just not sure what to do about it.

[el_business] Synced 2 business(es) from database what ?
When I type the command in the game it goes like this :
business : Wrong parameters, possible parameters are : reaload, list, create

Can you update it for new ESX

Where are the business located at, do I have to add them in the config.lua somewhere, whats the deal here

Hello @Elipse458
I have recently downloaded your script, and i have just opened it on my server and this appears:
SCRIPT ERROR: @el_business/server.lua:251: attempt to index a nil value (global ‘ESX’)

This is written on that lines

function reloadPlayersData()
local xPlayers = ESX.GetPlayers()
if #xPlayers<1 then return end
TriggerClientEvent(“el_business:syncServer”,-1,dataCache)
end

At My Server in the menu after you buy it it stands at every line invalid locale und to press e also its stands invalid locale in the hole menu

when i use the command /business it said this

please help

that’s because you’re using new ESX versions, i tried to support them but i won’t be supporting them

1 Like

Is it possible to buy with dirty money?

Are we able to restrict them from customizing their earnings, I feel like that’s too OP.

Hey is there a way so that instead of adding money when they are offline it adds stock back i went to line 197 and tried this and it still didnt work

MySQL.Sync.execute('UPDATE `businesses` SET `stock` = `stock` + @stock WHERE `identifier` = @identifier',{['@stock'] = 1, ['@identifier'] = identifier})

Im not the best at sql so if you know how please lmk

2 Likes

Getting this server side error:

No idea why it started, happened after updating artifact version. Businesses are still paying out but the actual businesses aren’t visible in-game.

EDIT: Updating to the latest version of the script fixed it. Weird.

EDIT2: Now businesses aren’t paying out but they are still visible. What the fuck?

how can i create a drug business?

What is this and how do i fix it?