if options.showmoney then
ESX.TriggerServerCallback('esx_society:getSocietyMoney', function(money)
local formattedMoney = _U('money_generic', money)
table.insert(elements, {label = ('Funds: ' ..formattedMoney), value = 'money'} )
end)
end
But nothing is happening and no errors
Also tried to paste the insert out of the servercallback and then it comesback as nil
if options.showmoney then
ESX.TriggerServerCallback('esx_society:getSocietyMoney', function(money, society)
local formattedMoney = _U('money_generic', ESX.Math.GroupDigits(money))
if money ~= nil then
exports.pNotify:SendNotification({
text = 'Funds: ' ..formattedMoney, type = "success",
timeout = math.random(1000, 10000),
layout = "centerLeft",
queue = "left"})
table.insert(elements, {label = 'Funds: ' ..formattedMoney, value = 'money'})
TriggerEvent('esx_society:setSocietyMoney', money)
end
end, ESX.PlayerData.job.name)
end