diff --git a/ND_CharacterSelection/config.lua b/ND_CharacterSelection/config.lua index b27ae82..d95e191 100644 --- a/ND_CharacterSelection/config.lua +++ b/ND_CharacterSelection/config.lua @@ -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"] = { diff --git a/ND_CharacterSelection/source/server.lua b/ND_CharacterSelection/source/server.lua index 2fcca79..05a4f24 100644 --- a/ND_CharacterSelection/source/server.lua +++ b/ND_CharacterSelection/source/server.lua @@ -63,4 +63,20 @@ AddEventHandler("ND_CharacterSelection:checkPerms", function() end end TriggerClientEvent("ND_CharacterSelection:permsChecked", player, allowedRoles) -end) \ No newline at end of file +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 \ No newline at end of file