Exports

Here you will find all the useful exports for this asset, please read each step and example carefully to better understand how it works, we do not recommend using these if you are not an experienced developer.


GetDutyData

To fetch player duty data you need to use following export.

exports['piotreq_jobcore']:GetDutyData()

Example of Usage

local data = exports['piotreq_jobcore']:GetDutyData()
print(json.encode(data, {indent=true}))

--[[
    {
        "status": 1,
    }
]]

DutyPlayersTrigger

You can use this export to trigger some client event for players with specific job.

  • eventName string

  • data any (args for event)

  • job string

  • online? boolean (if true then only trigger for players which are on duty else all players in table

Example of Usage


On Duty Update

With this event handler you are able to follow player duty updates.


ResetDutyTimer

You can use this export to reset duty time for specific player.

  • identifier string

Example of Usage


ResetDutyTimers

With this export you can reset duty time for all players in specific job.

  • job string

  • type string ("all", "online", "offline")

Example of Usage


ToggleDuty

You can use following trigger to toggle duty status

  • duty number (0 = off duty, 1 = on duty, 2 = break)


FormatDutyTime

Use following export to receive formatted duty time

  • time number

Example of Usage


SavePlayerDutyTime

You can use this export to save player duty time manually.

  • identifier string

  • time number

Example of Usage


isPlayerOnDuty

You can check if specific player is on duty with this export.

  • identifier string

Example of Usage


GetJobDutyPlayers

With this export you are able to get all online players with specific job

  • job string

Example of Usage


GetAllDutyPlayers

This export will get all online players with job from config

Example of Usage


SetPlayerDutyData

  • identifier string

  • data table

  • playerId string

  • jobName string

  • status number

  • time number

  • startTime? number

Example of Usage


GetJobActivePlayers

This export will return on duty players count from specific job / jobs.

  • job string / table

Example of Usage

Last updated