el_business icon indicating copy to clipboard operation
el_business copied to clipboard

error server.lua

Open MrAlmagro opened this issue 4 years ago • 16 comments

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

`

Now it has also appeared in line 262

MrAlmagro avatar Apr 28 '20 20:04 MrAlmagro

try restarting the resource lol

Elipse458 avatar Apr 29 '20 01:04 Elipse458

if that doesn't work you might be using an event scrambler or something that changes the esx:getSharedObject event

Elipse458 avatar Apr 29 '20 01:04 Elipse458

Then, what should i writte?

El mié., 29 abr. 2020 3:42, Elipse458 [email protected] escribió:

if that doesn't work you might be using an event scrambler or something that changes the esx:getSharedObject event

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Elipse458/el_business/issues/9#issuecomment-620943574, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOOE5VW64GSVDHC7GCI5WX3RO6AZPANCNFSM4MTEO6VA .

MrAlmagro avatar Apr 29 '20 08:04 MrAlmagro

I have alreasy fixed it. But how can i do for it to make income even if the person is disconected?? Ty if you answer

MrAlmagro avatar Apr 29 '20 17:04 MrAlmagro

change the sql query on line 197 in server.lua

Elipse458 avatar Apr 29 '20 19:04 Elipse458

What should i change??

function addMoney(identifier,money,business) if not identifier then return end local xPlayer = ESX.GetPlayerFromIdentifier(identifier) local money = math.floor(tonumber(money)) if xPlayer then print("[^1"..GetCurrentResourceName().."^7] Adding money to "..GetPlayerName(xPlayer.source).." - "..identifier.." ("..tostring(money).."$)") TriggerClientEvent('esx:showNotification', xPlayer.source, _L("received_money"):format(tostring(money),business)) xPlayer.addAccountMoney("bank", math.floor(money)) else print("[^1"..GetCurrentResourceName().."^7] An error occured while adding money to "..identifier.." ("..tostring(money).."$). The player is offline. Forcing adding money") MySQL.Sync.execute('UPDATE users SET bank = bank + @bank WHERE identifier = @identifier',{['@bank'] = money, ['@identifier'] = identifier}) end end

MrAlmagro avatar Apr 29 '20 19:04 MrAlmagro

are you using latest esx?

Elipse458 avatar Apr 29 '20 19:04 Elipse458

Yep

El mié., 29 abr. 2020 a las 21:09, Elipse458 ([email protected]) escribió:

are you using latest esx?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Elipse458/el_business/issues/9#issuecomment-621406163, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOOE5VQB7IP3TBM73FJJFXTRPB3PDANCNFSM4MTEO6VA .

MrAlmagro avatar Apr 29 '20 19:04 MrAlmagro

well then, like i said, change the sql query to be compatible with it

Elipse458 avatar Apr 29 '20 19:04 Elipse458

Yes, now It is compatible with my server, and It is working. But i want to know, if people could get money even when offline.

If is is already configured like that, pls tell It to me

El mié., 29 abr. 2020 21:16, Elipse458 [email protected] escribió:

well then, like i said, change the sql query to be compatible with it

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Elipse458/el_business/issues/9#issuecomment-621409872, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOOE5VTHO7INTZNRWVSOGQ3RPB4KPANCNFSM4MTEO6VA .

MrAlmagro avatar Apr 29 '20 19:04 MrAlmagro

i already told you twice what you need to do

Elipse458 avatar Apr 29 '20 19:04 Elipse458

You told me the line i have to change, but not what to put!! Pls help me

El mié., 29 abr. 2020 a las 21:55, Elipse458 ([email protected]) escribió:

i already told you twice what you need to do

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Elipse458/el_business/issues/9#issuecomment-621428816, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOOE5VSBZ5CDXKVA6GKPIHTRPCA3ZANCNFSM4MTEO6VA .

MrAlmagro avatar Apr 29 '20 20:04 MrAlmagro

idk what you need to put there, i don't use latest esx, you'll need to figure that out by yourself

Elipse458 avatar Apr 29 '20 20:04 Elipse458

Which one should i use then? So that i can configure that?

El mié., 29 abr. 2020 a las 22:19, Elipse458 ([email protected]) escribió:

idk what you need to put there, i don't use latest esx, you'll need to figure that out by yourself

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Elipse458/el_business/issues/9#issuecomment-621440762, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOOE5VUZYV4F6B4ORBAULOLRPCDWHANCNFSM4MTEO6VA .

MrAlmagro avatar Apr 29 '20 20:04 MrAlmagro

v1.1.0

Elipse458 avatar Apr 29 '20 20:04 Elipse458

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

`

Now it has also appeared in line 262

Can u tell how u fix it pls??? Thank you :) @MrAlmagro

dimoni666 avatar May 15 '21 15:05 dimoni666