Skip to main content

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

  1. Put ensure sqz_duty to your start config and resource called sqz_duty into your resources folder
  2. Run the SQL file
  3. Configure s_config.lua & sh_config.lua

Optional modifications

  1. To add the duty element to your boss menu:

(small snippet https://pastebin.com/E2PedQtn)

  • All the changes are done in client/main.lua Change this:
  1. Replace n esx_society/client/main.lua:77

    local elements = {}

    for

    local elements = {
    {label = 'Show Duty Time of employees', value = 'dutyTime'}
    }
  2. 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)

Events used

  1. 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 server
  2. TriggerServerEvent('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.
  3. 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