Server

Server Exports

--- Retrieves information about a player's unit from the HubList.
--- This function searches the `HubList` for a unit associated with the specified player ID.
--- @param playerId integer - The player's source ID to search for.
--- @return table , string ( A table containing the unit's data if found and its department hub; otherwise, `false` for either.
---   The unit table contains:
---     - source (integer): The player's source ID.
---     - name (string): The player's character name
---     - callsign (string): The player's callsign
---     - job (string): The player's job code
---     - coords (vector2) : The player's coords
---     - Rank (string) : The player's Grade rank
---     - Duty (boolean) : The player's Duty Status
---     - Busy (boolean) : The player's Busy Status
---     - Radio (string) : Return player's Radio Channel 
---     - Dispatch (boolean) : The player's Dispatch Mode
---   The hub key is the string key identify unit department like [POLICE,EMS].
exports['l2s-dispatch']:GetUnitInfo(source)

--- Calculates the total number of units in a specified hub.
--- This function counts the number of units in the specified hub, optionally including off-duty units
--- and filtering by a specific job.
--- @param hub string - The hub name to search within.
--- @param includeOffDuty boolean - Whether to include off-duty units in the count.
--- @param SpecificJob string|nil - The specific job to filter units by. If `nil`, all jobs are included.
--- @return integer - The total number of units matching the criteria.
exports['l2s-dispatch']:GetHubTotal(hub, includeOffDuty, SpecificJob)



Last updated