Hey mate, did you figured out?
Excellent addition for any server thx
1 Like
Is this compatible with Legacy 1.9.1 its just code looks different for es extended, trying to figure out how to use your code to replace default messages etc
example for Paycheck if I was just to have custom message, what would I input:
Original code:
function StartPayCheck()
CreateThread(function()
while true do
Wait(Config.PaycheckInterval)
for player, xPlayer in pairs(ESX.Players) do
local job = xPlayer.job.grade_name
local salary = xPlayer.job.grade_salary
if salary > 0 then
if job == 'racer' then -- unemployed
xPlayer.addAccountMoney('bank', salary, "Welfare Check")
TriggerClientEvent('esx:showAdvancedNotification', player, TranslateCap('bank'), TranslateCap('received_paycheck'), TranslateCap('received_help', salary),
'CHAR_BANK_MAZE', 9)
elseif Config.EnableSocietyPayouts then -- possibly a society
TriggerEvent('esx_society:getSociety', xPlayer.job.name, function(society)
if society ~= nil then -- verified society
TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function(account)
if account.money >= salary then -- does the society money to pay its employees?
xPlayer.addAccountMoney('bank', salary, "Paycheck")
account.removeMoney(salary)
TriggerClientEvent('esx:showAdvancedNotification', player, TranslateCap('bank'), TranslateCap('received_paycheck'),
TranslateCap('received_salary', salary), 'CHAR_BANK_MAZE', 9)
else
TriggerClientEvent('esx:showAdvancedNotification', player, TranslateCap('bank'), '', TranslateCap('company_nomoney'), 'CHAR_BANK_MAZE', 1)
end
end)
else -- not a society
xPlayer.addAccountMoney('bank', salary, "Paycheck")
TriggerClientEvent('esx:showAdvancedNotification', player, TranslateCap('bank'), TranslateCap('received_paycheck'), TranslateCap('received_salary', salary),
'CHAR_BANK_MAZE', 9)
end
end)
else -- generic job
xPlayer.addAccountMoney('bank', salary, "Paycheck")
TriggerClientEvent('esx:showAdvancedNotification', player, TranslateCap('bank'), TranslateCap('received_paycheck'), TranslateCap('received_salary', salary),
'CHAR_BANK_MAZE', 9)
end
end
end
end
end)
end
And If I was to override all of es extended, my code looks different to your very good explanation on gitā¦
But I am still learning everyday and very confused.
1 Like
Hi, unless i havenāt figure it out but the bold text (~h~) canāt be stop when u but another ~h~ where you want it to end it donāt end
Best code I have seen in a while, especially for being free great work!
1 Like
plz help not working
i want to make a custom jpg but it does not work pls help