Licences

Provides a standalone licence system supporting driving, weapon, hunting licences and more, with support for points and revocation. Framework-agnostic.


Accessing the Module

local LICENCES <const> = exports.boii_utils:get("modules.licences")

Server

get_licences(source)

Retrieves all licences for a player.

Parameters

Name
Type
Description

source

number

Player source identifier

Example

local all_licences = LICENCES.get_all(source)

get_licence(source, licence_id)

Retrieves a specific licence for a player.

Parameters

Name
Type
Description

source

number

Player source identifier

licence_id

string

Licence ID

Example


add_licence(source, licence_id)

Grants a player a new licence.

Parameters

Name
Type
Description

source

number

Player source ID

licence_id

string

Licence ID to add

Example


remove_licence(source, licence_id)

Removes a player's licence.

Parameters

Name
Type
Description

source

number

Player source ID

licence_id

string

Licence ID to remove

Example


add_points(source, licence_id, points)

Adds penalty points to a player's licence.

Parameters

Name
Type
Description

source

number

Player source ID

licence_id

string

Licence ID to modify

points

number

Points to add

Example


remove_points(source, licence_id, points)

Removes penalty points from a player's licence.

Parameters

Name
Type
Description

source

number

Player source ID

licence_id

string

Licence ID to modify

points

number

Points to remove

Example


update_licence(source, licence_id, test_type, passed)

Updates a licence to mark theory or practical passed.

Parameters

Name
Type
Description

source

number

Player source ID

licence_id

string

Licence ID to update

test_type

string

Either "theory" or "practical"

passed

boolean

true if passed, false if not

Example


Client

get_licences()

Triggers server callback to fetch current player's licences.

Parameters

None

Example

Last updated