Civilian Integration

Allows players to fetch ID information from the CAD on demand.

This submodule allows players to fetch their character information from the CAD. Basic functionality is provided with the /showid command, but developers are encouraged to use the export for their own creations.

Sonoran CAD - Civilian Integration Lookup

Activation Guide

1. Download and Install the Core

If you haven't already, be sure to install and configure the SonoranCAD Core first.

2. Activate the Submodule and all Dependencies

  1. Follow the submodule activation guide for the civintegration, and locations submodules.

3. Set Your API ID

Don't forget to set your account API ID to properly link your in-game user to the CAD.

Further Configuration

Option

Description

Default Value

cacheTime

Time to cache characters in seconds

3600

allowCustomIds

Allow players to use /setid to set a custom name.

true

allowPurge

Allow players to use /refreshid to "purge" their character list from cache.

true

enableIDCardUI

Recommended: Allows for a more realistic identification ui with /showid IF USING: Please ensure you start the resource sonoran_idcard BEFORE sonorancad in your server resource start order

false

Usage

Commands

The submodule comes with a few basic commands to show off the functionality.

Command

Description

/showid [id]

Shows the current ID of the specified player ID. If not specified, will show the current player's ID. Currently, it is displayed only to the calling client.

/setid

Sets a custom ID (first/last name, and date of birth). Overrides the currently selected CAD ID. Can be disabled in configuration.

/resetid

Resets the custom ID specified above.

/refreshid

Removes the "cached" characters for the client. This allows players to swap characters in the CAD without relogging or waiting for the cache timer.

Export

You can use this export to fetch all characters for a specific player ID. This is a server-side export only.

Function: "GetCharacters"
Parameters:
    player: the player ID
    callback: function to call after fetching the data. Returns an array of character objects.

Example:
    exports["sonorancad"]:GetCharacters(playerId, function(result)
        -- do stuff with result, an array of character objects
    end)

This function can also be used in other submodules (without the export bit).

Last updated

Was this helpful?