Paychecks!

This commit is contained in:
WLVF
2022-09-01 04:07:40 -04:00
parent 140bbcb06b
commit 803727e4e0
2 changed files with 32 additions and 6 deletions

View File

@@ -7,15 +7,15 @@ config = {
aopExport = function()
return exports["SimpleHUD"]:getAOP() -- exports["ModernHUD"]:getAOP()
end,
-- set your backgrounds, if you have more than 1 then it will randomly change everytime you open the ui.
backgrounds = {
"https://i.imgur.com/E51ckFx.png", -- Credits: Fuzzman270#0270
"https://i.imgur.com/SeZD7TP.png", -- Credits: Fuzzman270#0270
"https://i.imgur.com/ZWKfYD9.png" -- Credits: 2XRondo#6374
"https://i.imgur.com/E51ckFx.png", -- Credits: Fuzzman270#0270
"https://i.imgur.com/SeZD7TP.png", -- Credits: Fuzzman270#0270
"https://i.imgur.com/ZWKfYD9.png" -- Credits: 2XRondo#6374
},
departments = {
departments = { -- these are the required discord role ids to be able to access these departments (enable developer mode in discord's advanced settings and right click the role)
["CIV"] = {"0"},
["SAHP"] = {"0"},
["LSPD"] = {"0"},
@@ -23,6 +23,16 @@ config = {
["LSFD"] = {"872921520719142932"}
},
departmentPaychecks = false, -- if you would like salaries to be paid out to the departments, set this to true
paycheckInterval = 24, -- this is how often (in minutes) paychecks are to be paid out if departmentPaychecks is set to true
departmentSalaries = { -- the amount given to the character per interval of time set via paycheckInterval
["CIV"] = 300,
["SAHP"] = 700,
["LSPD"] = 600,
["BCSO"] = 500,
["LSFD"] = 650
},
-- set up the spawn buttons for each department.
spawns = {
["CIV"] = {

View File

@@ -63,4 +63,20 @@ AddEventHandler("ND_CharacterSelection:checkPerms", function()
end
end
TriggerClientEvent("ND_CharacterSelection:permsChecked", player, allowedRoles)
end)
end)
if config.departmentPaychecks then
CreateThread(function()
while true do
Wait(config.paycheckInterval * 60000)
for player, playerInfo in pairs(NDCore.Functions.GetPlayers()) do
local salary = config.departmentSalaries[playerInfo.job]
NDCore.Functions.AddMoney(salary, player, "bank")
TriggerClientEvent("chat:addMessage", player, {
color = {0, 255, 0},
args = {"Salary", "Received $" .. salary .. "."}
})
end
end
end)
end