mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-18 22:36:03 +01:00
Paychecks!
This commit is contained in:
@@ -15,7 +15,7 @@ config = {
|
|||||||
"https://i.imgur.com/ZWKfYD9.png" -- Credits: 2XRondo#6374
|
"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"},
|
["CIV"] = {"0"},
|
||||||
["SAHP"] = {"0"},
|
["SAHP"] = {"0"},
|
||||||
["LSPD"] = {"0"},
|
["LSPD"] = {"0"},
|
||||||
@@ -23,6 +23,16 @@ config = {
|
|||||||
["LSFD"] = {"872921520719142932"}
|
["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.
|
-- set up the spawn buttons for each department.
|
||||||
spawns = {
|
spawns = {
|
||||||
["CIV"] = {
|
["CIV"] = {
|
||||||
|
|||||||
@@ -64,3 +64,19 @@ AddEventHandler("ND_CharacterSelection:checkPerms", function()
|
|||||||
end
|
end
|
||||||
TriggerClientEvent("ND_CharacterSelection:permsChecked", player, allowedRoles)
|
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
|
||||||
Reference in New Issue
Block a user