Exports

Server

exports.lvs_idmanager:create

Syntax

exports.lvs_idmanager:create(playerId, typeId, extra)

Parameters

  • playerId (number): The player's server ID.

  • typeId (string): One of the types defined in Config.CardType (located in config.lua).

  • extra (table | nil): Optional parameter used when typeId is 'driver'. It should contain the key class, indicating the driver's license class.

Return Value

  • If typeId does not exist in Config.CardType, the function returns nil.

  • On success, the function grants the player an item with the following metadata:

        type = 'identification'
        id_number 
        id_type
        id_cid
        id_dob
        id_firstname
        id_lastname
        id_sex
        id_nationality
        id_photo
        id_job? -- Only on jobs id's
        id_occupation? -- Only on jobs id's
        id_class? -- Only if typeId is 'driver'

Example Usage

Notes

  • If typeId is not defined in Config.CardType, the function returns nil and does not execute any actions.

  • If typeId is 'driver', it is recommended to always provide a valid extra.class.

  • Best Practice: Before granting the item, it is advisable to check whether the player can carry it to avoid inventory issues.


exports.lvs_idmanager:createFake

Syntax

Parameters

  • playerId (number): The player's server ID.

  • typeId (string): One of the types defined in Config.CardType (located in config.lua).

  • data (table): A table containing the following information:

Return Value

  • If typeId does not exist in Config.CardType, the function returns nil.

  • On success, the function grants the player an item with the same metadata structure as create.

Example Usage

Notes

  • If typeId is not defined in Config.CardType, the function returns nil and does not execute any actions.

  • If typeId is 'driver', it is recommended to always provide a valid extra.class.

  • Best Practice: Before granting the item, it is advisable to check whether the player can carry it to avoid inventory issues.


exports.lvs_idmanager:isFake

Syntax

Parameters

  • metadata (table): ID Item metadata to check.

Return Value

  • Returns true if the document type is illegal (fake), otherwise false.

Example Usage


exports.lvs_idmanager:isOwner

Syntax

Parameters

  • playerId (number): The player's server ID.

  • metadata (table): The data of the identification item metadata.

Return Value

  • Returns true if the identification belongs to the specified playerId, otherwise false.

Example Usage

Last updated