βοΈExports
You can use our provided exports to seamlessly integrate this script into your server.
Server Side exports
--- Clocks the player on duty using their server ID.
--- @param src number The player's server ID.
exports["g-dutyV2"]:clockOnDuty(src)
--- Clocks the player off duty using their server ID.
--- @param src number The player's server ID.
exports["g-dutyV2"]:clockOffDuty(src)
--- Saves all current duty times to the database.
--- Useful if you've updated job info using admin commands and want to persist the current duty state.
exports["g-dutyV2"]:saveAllDutyTimes()
--- Checks whether the player is currently on duty.
--- @param src number The player's server ID.
--- @return boolean Returns true if the player is on duty, false otherwise.
exports["g-dutyV2"]:isOnDuty(src)
--- Checks if a player has already claimed a specific reward.
--- @param identifier string The player's identifier (e.g., Steam license).
--- @param rewardId number The unique ID of the reward (must match the one set in SV_CONFIG.Rewards).
--- @return boolean Returns true if the reward has been claimed, false otherwise.
exports["g-dutyV2"]:HasPlayerClaimedReward(identifier, rewardId)
--- Retrieves the total duty time for a player.
--- @param src number The player's server source ID.
--- @param formatted? boolean If true, returns formatted time (e.g., "3h 6m 55s"); if false or nil, returns total time in raw seconds.
--- @return string | number The player's total duty time as a formatted string or a number (in seconds).
-- Example usage:
-- local time = exports["g-dutyV2"]:GetDutyTime(123, true)
exports["g-dutyV2"]:GetDutyTime(src, formatted)
Client Side exports
--- Opens the duty clock-in/clock-out menu for the player.
--- Useful for placing in interaction zones or command bindings.
exports["g-dutyV2"]:OpenClockMenu()
--- Opens the boss duty management menu (only available if player has access).
--- Allows boss or high-grade players to view duty logs and manage rewards.
exports["g-dutyV2"]:OpenDutyBossMenu()
--- Clocks the local player on duty.
--- Can be used for custom interactions or hotkey triggers.
exports["g-dutyV2"]:clockOnDuty()
--- Clocks the local player off duty.
--- Can be used for custom interactions or hotkey triggers.
exports["g-dutyV2"]:clockOffDuty()
Last updated