Compamy funds in menu

Hi i tried adding a label in the bossmenu

With this.

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

Any idea how to fix this

@Lenzh_FX does you found any solution for this?

Idk where are u putting that but the callback needs to pass the society name. Replace end) with end, ‘society_police’) or whatever

I want it so all society bossmenus get it so i put it in esc society

oke i did this

  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

the pNotify is displaying but the label isnt

@Lenzh_FX post your esx_society/main.lua and ill fix it.

Just the default one with the coded added above and set to true on the lpcal options

I have add this;

local society_money = 0

This inside function RefreshBussHUD() and function UpdateSocietyMoneyHUDElement(money)

society_money = money

if options.money then
table.insert(elements, {label = 'La sociedad tiene ’ … society_money … ‘€’, value = ‘check_money’})
end

1 Like

saw you got this to work, mind sharing what you did, i cant seem to get it to show.

post ur esx_society/main.lua

main.lua (49.8 KB)

let’s try:
main.lua (50.1 KB)

It shows up but it tells me there is 0$ when 300k is in the society, i tried adding a $ to refresh it but it still shows 0$

u restart the server? or only restart resource?

resource, but i tried refreshing it by adding and removing money, ill restart now :wink:

works thank you

1 Like

same here shows $0, help me please, here is my client/main.lua

main.lua (10.6 KB)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.