Hi guys,
I’m running a server and I’m trying to make it so when you’re the boss of a whitelisted job, it will display the society account money on the hud (the hud part is not really relevant since only obtaining the actual account money is what I’m trying to achieve right now…)
I know my basic function to determine if the player is the boss of the company works, you can see it in the screenshot below.
Here is the associated code for this part.
if data.job.grade_name == "boss" then
--local society = "society_"..data.job.name
--TriggerServerEvent('esx_addonaccount:getSharedAccount', society, function(account)
SendNUIMessage({action = "setValue", key = "societymoney", value = " | 🏢 BOSS "})
--end)
end
As soon as I remove the commented lines and make it like this :
if data.job.grade_name == "boss" then
local society = "society_"..data.job.name
TriggerServerEvent('esx_addonaccount:getSharedAccount', society, function(account)
if account ~= nil then
account = account
SendNUIMessage({action = "setValue", key = "societymoney", value = " | 🏢 "..account.money})
end
end)
end
Its not working and keep giving me error related to my trigger I use to get the society money info…
I don’t want a piece of code, I’d like some inputs \ guidance towards finding how to do it by myself.
Thanks !