For the complete documentation index, see llms.txt. This page is also available as Markdown.

βš™οΈExports & Events

Exports and open-function hooks exposed by the License System for integrating with other resources.

The License System exposes client and server exports plus two open-function tables β€” OpenClientFunctions (in configs/c.functions.lua) and OpenServerFunctions (in configs/s.functions.lua) β€” that you can edit to react to in-game events.

Client Exports

Call these from any client script as exports['devhub_licenses']:<name>(...).

exports['devhub_licenses']:openMdt(isLaptopApp)            -- Open the license MDT tablet
exports['devhub_licenses']:openCardHolder()                -- Open the local player's card holder
exports['devhub_licenses']:openCardHolderForPlayer(targetServerId) -- Open another player's card holder
exports['devhub_licenses']:openFavoriteHand()              -- Open the favorite licenses hand display

exports['devhub_licenses']:getMyLicenses()                 -- Licenses owned by the local player
exports['devhub_licenses']:getAllMyLicenses()              -- All licenses the local player carries
exports['devhub_licenses']:getLicenseById(licenseId)       -- A single carried license by ID
exports['devhub_licenses']:hasLicense(templateName)        -- bool, licenseId β€” active license of a template?
exports['devhub_licenses']:getLicenseCount(templateName)   -- Count owned (optionally by template)
exports['devhub_licenses']:getMyFavorites()                -- The local player's favorite licenses

exports['devhub_licenses']:showLicenseTerminal(callback)   -- Open a scan terminal with a scan callback
exports['devhub_licenses']:closeLicenseTerminal()          -- Close the scan terminal
  • openMdt(isLaptopApp): Opens the MDT; pass true when opening as a devhub_laptop app.

  • openCardHolderForPlayer(targetServerId): Opens the card holder for another player (police search, etc.); targetServerId is required.

  • hasLicense(templateName): Returns true plus the matching licenseId if the player has an active license of that template.

  • getLicenseCount(templateName): Counts carried licenses; omit templateName to count all.

  • showLicenseTerminal(callback): Opens a scan terminal. The callback(license) receives the scanned license and returns a result table such as { success = true, message = "Access Granted" }. See configs/c.terminal_demo.lua for a full example.


Server Exports

Call these from any server script as exports['devhub_licenses']:<name>(...).

  • updateLicenseStatus(...): newStatus must be one of active, suspended, revoked, lost, expired. owner is the license owner's identifier; suspensionTime is a Unix timestamp for when a suspension ends.

  • destroyLicense(source, owner, licenseId): Permanently removes the license and fires the OnLicenseDestroyed hook.

  • getPlayerLicenseCount(source, templateName, status): Both templateName and status are optional filters.

  • getPlayerLiveData(source): Runs each DataFields getData() function for the player and returns the live values.


Client Open Functions

Edit the OpenClientFunctions table in configs/c.functions.lua to react to client-side events. Functions whose comment says "Return false to …" can cancel the action by returning false.

OnHideoutDoorHandler and OnHideoutCarpetHandler are called repeatedly by the target system to decide whether to show the interaction option β€” not once on interaction. Return true to show it, false to hide it.


Server Open Functions

Edit the OpenServerFunctions table in configs/s.functions.lua to react to server-side events. By default each hook sends a Discord log via Config.LogsWebhook. Hooks documented as "Return false to …" can block the action.

  • CanPickupLicense: Run custom checks before a player picks up a license at the city hall NPC β€” e.g. require passing a driving test. Return false to deny.

  • OnPlayerLicensesChecked: Gate license checks behind a job (e.g. police only) by returning false for unauthorized players.

  • OnLicenseStatusChanged: source may be nil when the change is automatic (system/offline), such as an expiration or suspension ending.

Last updated