[Release] ESX_ShowCommands (/showjob,cash,bank,dirty and society)

For everyone having the Society 0 issue. Double check your server.cfg and make sure that esx_showcommands loads after esx_society. Personally i moved “ensure esx_showcommands” to the bottom of my server.cfg and it fixed it straight away.

Any Way To Add a way to see your 2nd job to this ?

not working for extendedmode

1 Like

Is this a fix for ESX V1 Final?

Not working on ESX V1 Final :frowning: Sad day, i loved this script but I am converting my 1.1 to V1 Final and its broken :frowning:

Replace your server.lua with this **

(please keep in mind I removed the show infront of all the commands so instead of /showbank or /showcash it is now /bank, /cash, /job, /info, /society)

ESX = nil
local RegisteredSocieties = {}

TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
local function getMoneyFromUser(id_user)
	local xPlayer = ESX.GetPlayerFromId(id_user)
	return xPlayer.getMoney()

end

local function getMoneyFromUser(id_user)
	local xPlayer = ESX.GetPlayerFromId(id_user)
	return xPlayer.getMoney()

end

local function getBlackMoneyFromUser(id_user)
		local xPlayer = ESX.GetPlayerFromId(id_user)
		local account = xPlayer.getAccount('black_money')
	return account.money

end

local function getBankFromUser(id_user)
		local xPlayer = ESX.GetPlayerFromId(id_user)
		local account = xPlayer.getAccount('bank')
	return account.money

end


RegisterCommand("job", function(source, args, rawCommand)
  local _source = source
  local xPlayer = ESX.GetPlayerFromId(_source)
  local job = xPlayer.job.label
  local jobgrade = xPlayer.job.grade_label
  TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You are working as: ' .. job .. ' - ' .. jobgrade})  
end)

RegisterCommand("cash", function(source, args, rawCommand)
  local _source = source
  local xPlayer = ESX.GetPlayerFromId(_source)
  local wallet = getMoneyFromUser(_source)
  TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You currently have $' .. wallet .. ' in your wallet'})
end)


RegisterCommand("bank", function(source, args, rawCommand)
  local _source = source
  local xPlayer = ESX.GetPlayerFromId(_source)
  local bank 			= getBankFromUser(_source)
  TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You currently have $' .. bank .. ' in your bank'})
end)

RegisterCommand("dirty", function(source, args, rawCommand)
  local _source = source
  local xPlayer = ESX.GetPlayerFromId(_source)
  local black_money 	= getBlackMoneyFromUser(_source)

  --TriggerClientEvent('esx:showNotification', _source, 'You currently have ~g~$~g~' .. black_money .. ' ~s~dirty money in your wallet~g~ ')
  TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You currently have $' .. black_money .. ' dirty money in your wallet'})
end)

RegisterCommand("info", function(source, args, rawCommand)
  local _source = source
  local xPlayer = ESX.GetPlayerFromId(_source)
  local job = xPlayer.job.label
  local jobgrade = xPlayer.job.grade_label
  local wallet 		= getMoneyFromUser(_source)
  local bank 			= getBankFromUser(_source)
  local black_money 	= getBlackMoneyFromUser(_source)
  if xPlayer.job.grade_name == 'boss' then
  local society = GetSociety(xPlayer.job.name)
  if society ~= nil then
    TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function(account)
      money = account.money
    end)
  else
    money = 0
  end

              TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You are working as: ' .. job .. ' - ' .. jobgrade})
              Citizen.Wait(1500)
              TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You currently have $' .. wallet .. ' in your wallet'})
              Citizen.Wait(1500)
              TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You currently have $' .. bank .. ' in your bank'})
              Citizen.Wait(1500)
              TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You currently have $' .. black_money .. ' dirty money in your wallet'})
              Citizen.Wait(1500)
              TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You currently have $' .. money .. ' in the society account'})

else
        
              TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You are working as: ' .. job .. ' - ' .. jobgrade})
              Citizen.Wait(1500)
              TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You currently have $' .. wallet .. ' in your wallet'})
              Citizen.Wait(1500)
              TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You currently have $' .. bank .. ' in your bank'})
              Citizen.Wait(1500)
              TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You currently have $' .. black_money .. ' dirty money in your wallet'})
              Citizen.Wait(1500)
              TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'error', text = 'Access not granted!'})

end
end)

RegisterCommand("society", function(source, args, rawCommand)
	local _source = source
    local xPlayer = ESX.GetPlayerFromId(_source)

	if xPlayer.job.grade_name == 'boss' then
		local society = GetSociety(xPlayer.job.name)
		if society ~= nil then
			TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function(account)
				money = account.money
			end)
		else
			money = 0
		end
		
                --TriggerClientEvent('esx:showNotification', _source, 'You currently have ~g~$~g~' .. money .. ' ~s~in the society account~g~ ')
	        TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'You currently have $' .. money .. ' in the society account'})
																	
	else
	        --TriggerClientEvent('esx:showNotification', _source, '~r~Access not granted!')
		TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'error', text = 'Access not granted!'})

	end
end)

TriggerEvent('esx_society:getSocieties', function(societies) 
	RegisteredSocieties = societies
end)
function GetSociety(name)
  for i=1, #RegisteredSocieties, 1 do
    if RegisteredSocieties[i].name == name then
      return RegisteredSocieties[i]
    end
  end
end
1 Like

Thanks for responding brother! I replaced the server.lua with above what you posted, but still nothing happens. Any other ideas for esx v1?

If you’re referring to V1 Final then yes it works for it because thats what I use. please take note that I changed the commands from /showbank /showcash /showjob to /bank /cash /job

I have attempted to use this in V1 Final and its not working, where do you have it placed in your CFG?

No replace your server.lua with the one I posted. Go into your server.lua hit ctrl + A to select everything. Then delete it and paste what I posted in. If that doesn’t work I’ll send you my copy.

1 Like

It didnt work. Could you send me that copy?

Thank you! This worked for ESX - 1.2(final)

1 Like

showsociety shows always 0 money, any idea?

Make sure there is actually money in the society account. I just tested this, and it worked perfectly fine.


Look the top right and bottom left i just put 20k in total and still says 0, but for other commands works normal

Hey i debuged this and show that on line 112 where it is looking for GetSciety i am getting nill

Then its probably something with your esx_society. Go download the latest version off of github. I took this video 2 minutes ago of it working perfectly.

They deleted the repo. Could you send me the one you have for esx 1.2 final
<3

I’m sorry I’m just now seeing this. Was it esx_society you were needing?

Sadly doesnt work for me but if anyone can help please message me :slight_smile: