el_business
el_business copied to clipboard
error server.lua
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
try restarting the resource lol
if that doesn't work you might be using an event scrambler or something that changes the esx:getSharedObject
event
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 .
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
change the sql query on line 197 in server.lua
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
are you using latest esx?
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 .
well then, like i said, change the sql query to be compatible with it
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 .
i already told you twice what you need to do
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 .
idk what you need to put there, i don't use latest esx, you'll need to figure that out by yourself
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 .
v1.1.0
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