Skip to content

Kivo Identity Creator Exports and Integration

Kivo Identity Creator does not declare any exports. It connects to other scripts through two client events, whose names you set in config.lua, and through the framework file shared/framework.lua.

Event Side Config option Default name Fired when
Confirm Client Config.callbackEvent kivo-multichar:identityCreated The player confirms the form.
Back Client Config.backEvent kivo-multichar:identityBack The player presses Back.

Both are local client events, triggered inside the player’s own game. Kivo Multichar registers handlers for the default names. The event that carries the form values is the confirm event. The Back event has no payload.

The confirm event passes one table with the values from the form. Print it once to see exactly what you receive on your version:

-- client side, in your own resource
AddEventHandler('kivo-multichar:identityCreated', function(payload)
print('Identity form confirmed', json.encode(payload))
end)

This runs next to Multichar’s own handler. It is useful for logging or for reacting to a confirmed form, but it does not replace Multichar’s work.

Nothing to wire. Multichar opens the form, receives the confirm or Back event, creates the character and spawns it. You only need:

  • Config.useIdentityCreator = true in Multichar (the default).
  • Config.callbackEvent and Config.backEvent left at their defaults.

Multichar opens the form with the client event kivo-identity:open and this data:

Field Description
caller The opening resource’s name.
managed true: the caller keeps its own camera live behind the form, so the creator does not create a camera or ped. Without it, the creator sets up its own camera and ped from Config.defaultCam and Config.defaultPedCoords.
slot The slot being created. Passed back in the confirm payload.
callbackEvent Event fired on confirm. Overrides Config.callbackEvent.
backEvent Event fired on Back. Overrides Config.backEvent.

The resource also sets GlobalState.kivoIdentityCreator to its folder name, which is how Multichar finds it.

With Config.selfHandle = true the creator writes the character to the database itself (QBX, QBCore and ESX) and then fires Config.callbackEvent so the calling script knows creation is done. In this mode you can set Config.callbackEvent to your own event name:

-- kivo-identity-creator/config.lua
Config.selfHandle = true
Config.callbackEvent = 'myscript:identityDone'
-- your own resource, client side
AddEventHandler('myscript:identityDone', function(payload)
-- the character now exists, continue your own flow
end)

Standalone mode is experimental. Test it on your framework before you rely on it. The way another script opens the form is not covered by the open files, so ask Kivo support if you need that.

Replacing the identity creator with another script

Section titled “Replacing the identity creator with another script”

Kivo Multichar has two supported ways to collect a new character’s details:

  1. Kivo Identity Creator (Config.useIdentityCreator = true).
  2. A built-in ox_lib dialog (Config.useIdentityCreator = false).

The open files contain no hook that lets a third party identity form take the creator’s place. To drop Kivo Identity Creator:

  1. In Kivo Multichar’s config.lua, set Config.useIdentityCreator = false.
  2. Remove ensure kivo-identity-creator from server.cfg.

The built-in dialog does not ask for height or nationality. See Examples in the suite for the defaults that are saved.

shared/framework.lua sets Config.framework. The field table in config.lua is keyed by that value. To show a different set of fields for a framework that is not built in, set a new key and add a matching table.

-- shared/framework.lua
Config = Config or {}
if GetResourceState('qbx_core') == 'started' then
Config.framework = 'qbx'
elseif GetResourceState('qb-core') == 'started' then
Config.framework = 'qb'
elseif GetResourceState('es_extended') == 'started' then
Config.framework = 'esx'
elseif GetResourceState('my_framework') == 'started' then -- placeholder name
Config.framework = 'myfw'
else
Config.framework = nil
end
-- config.lua
Config.fields.myfw = {
firstname = true,
lastname = true,
dob = true,
gender = true,
height = false,
nationality = false,
}

Use Config.fields to match your server rules. For example, a roleplay server that does not store height can hide it everywhere:

Config.fields.qbx.height = false