[RELEASE] Esx_upgraded_duty

Hello FiveM Community, This script is very important mostly for Roleplay Servers (ESX).

This upgraded version of esx_duty and work better and optimizer and advance stuff

Features

  • Create off duty jobs just with one command
  • Much optimizer than others and get low usage (0.01 and 0.20% on idle)
  • Have lots of exports for scripting like blocking something for on duty on other scripts
  • Multi help options on config
  • Multi notify options on config
  • Multi-color for on and off duty
  • Added more locates
  • Can have multi-location for jobs just on configs
  • Can enter any off duty jobs (because someone doesn’t like to have a job like offpolice)
  • Added one method and config to don’t check all the zones to get lower usage
  • Clean coding

IMPORTANT

Resources provided with this script have additional code alongside the original code to make the duty fully functional at install. If you have these resources already then make sure to remove or disable them to prevent any conflict.

Resource preview

Video

Requirements

  • ESX
  • MySQL
  • Brain

Github

Download & Installation

Installation

  • Add this in your server.cfg in the following order:
start esx_upgraded_duty

Make off duty jobs

  • Just need to execute the command in your cmd like this:
CreateOffDutyJob [jobname]
CreateOffDutyJob ambulance

Exports

Client

Export Description Parameter(s) Return type
CheckDuty Returns player is on duty or not true or false or nil
GetOffDutyJobs Returns a list of off duty jobs table
GetOnDutyJobs Returns a list of on-duty jobs table
IsJobOnDuty Returns that job is on duty job or not string true or false or nil
IsJobOffDuty Returns that job is off duty job or not string true or false or nil

Server

Export Description Parameter(s) Return type
CheckDuty Returns player id is on duty or not int true or false or nil
GetOffDutyJobs Returns a list of off duty jobs table
GetOnDutyJobs Returns a list of on-duty jobs table
IsJobOnDuty Returns that job is on duty job or not string true or false or nil
IsJobOffDuty Returns that job is off duty job or not string true or false or nil

Credits

Resources used:

12 Likes

nice :wink:

1 Like

really good :clap:t2:

1 Like

what is the brain resource?

2 Likes

that not script that one part of humans

must be something many people dont use sometimes :face_with_hand_over_mouth:

3 Likes

offduty name in database are created automatic?

1 Like

You execute the command in your cmd like CreateOffDutyJob ambulance to add off duty ambulance job on your database

Great resource, i love it!

1 Like

For a moment I thought, it will not be a script, I guess he means that you have to have knowledge about this, but I say, just in case I’m going to ask him hahahahahaha

1 Like

Another useless resource
NICE!

You forgot to add '@mysql-async/lib/MySQL.lua', inside your fxmanifest.lua

1 Like

fixed I removed that accidentally on remaking fxmanifest.lua Thanks for the report :smile:

1 Like

Well done! Love that you use exports

1 Like

Thanks for the positive feedback :smile:

1 Like

Having an issue where the markers aren’t showing up in game. I’ve created the offduty jobs using the cmd and I’ve confirmed they are in the database. Also no errors in either my F8 console or server console when starting the server or ensuring the script.

Hi!

Where can I put my server event to log in service time?

TriggerServerEvent("utk_sl:dutyChange", "ambulance", true)
1 Like

Hi
at the first, it’s better to see that event Snippet code but I think this should work
add this under TriggerServerEvent('esx_duty:toggleduty') in line 127

if offdutyjobsinfo[playerjob] then
	TriggerServerEvent("utk_sl:dutyChange", offdutyjobsinfo[playerjob], true)
else
	TriggerServerEvent("utk_sl:dutyChange", playerjob, false)
end
1 Like

It works fine. Thanks :smiley:

1 Like

Sorry for ask again but could you help me to export the radio frecuency for each job?

Example: I need this witn police go on duty:

exports["rp-radio"]:GivePlayerAccessToFrequency(1)

And this when user go off duty:

exports["rp-radio"]:RemovePlayerAccessToFrequency(1)

And to this for all works (ems, police, taxi, etc)