Duty
Introduction
An Advanced duty system that allows you to check in via command/on certain places and tracks your time in-duty, boss of your society can review your time on-duty.
Get it now!
Instalation
- Put
ensure sqz_duty
to your start config and resource calledsqz_duty
into your resources folder - Run the SQL file
- Configure s_config.lua & sh_config.lua
Optional modifications
- To add the duty element to your boss menu:
- ESX
- QBCore
(small snippet https://pastebin.com/E2PedQtn)
- All the changes are done in client/main.lua Change this:
-
Replace n esx_society/client/main.lua:77
local elements = {}
for
local elements = {
{label = 'Show Duty Time of employees', value = 'dutyTime'}
} -
Add the part bellow to line 168 (the end of the if condition)
elseif data.current.value == 'dutyTime' then
TriggerServerEvent('sqz_duty:GetEmployes', ESX.PlayerData.job.name)
For QB Core:
(small snippet https://pastebin.com/E2PedQtn)
- All the changes are done in client/cl_boss.lua
-
At the end of
RegisterNetEvent('qb-bossmenu:client:OpenMenu', function()
event, into bossMenu locale paste:{
header = "Employees Duty",
txt = "Shows Duty time of your employes",
icon = "fa-solid fa-sack-dollar",
params = {
event = "qb-bossmenu:client:DutyTime",
}
}, -
At the end of the file add:
RegisterNetEvent('qb-bossmenu:client:DutyTime', function()
TriggerServerEvent('sqz_duty:GetEmployes', PlayerJob.name)
end)
Events used
TriggerServerEvent('sqz_duty:GetEmployes', ESX.PlayerData.job.name)
Event for opening boss menu with time of players. Make sure you provide the job which maches xPlayer.job.name on serverTriggerServerEvent('sqz_duty:ResetTime', identifier, ESX.PlayerData.job.name)
Event for reseting player time spent on server in the job, identifier should match targets xPlayer.identifier and the second argument is job name.TriggerServerEvent('sqz_duty:ChangeJob')
Event for changing job (mainly off to non off and if you have special job in Config, it will count on it with it.)
Common issues
- I can not see duty times in the boss menu
- If you use txAdmin, it saves (by default) on every scheduled restart
- If you do not use txAdmin, you have to trun that option off in your config and it will be saved every 6 hours (by default)
- It is due to prevetion of spam of Discord messages
- I keep getting message: "You SHOULD restart your server now" even after restarting your server
- One of the jobs in Config.Points Jobs is missing in your database. Then delete all the off jobs that were party inserted and then restart the script