Client Character

Import

---@type NssLibsClientCharacterApi
character_client_api = exports.nss_libs:getClientCharacterApi(GetCurrentResourceName())

Methods

listenSelectedCharacter(callback, on_destroy_callback)

  • callback (function) - The callback function that will be called when a character is selected.

    • char_id (number) - The character id of the selected character.

  • on_destroy_callback (function, optional) - The callback function that will be called when the listener is destroyed.

Returns an NssLibsSharedHelperEventHandlerApi instance. The listener is initially active.

character_client_api:listenSelectedCharacter(function(char_id)
    print('Selected character id: ' .. char_id)
    -- DO YOUR STUFF HERE
end)

resetAllSelectedCharacterListener()

Resets only all "on selected character" event handler of the given resource name.

Returns the current used NssLibsClientCharacterApi instance.


resetApi()

Resets the whole character api for the given resource name.

Returns the current used NssLibsClientCharacterApi instance.


Last updated

Was this helpful?