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.
Events
Section titled “Events”| 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 resourceAddEventHandler('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.
Using the creator with Kivo Multichar
Section titled “Using the creator with Kivo Multichar”Nothing to wire. Multichar opens the form, receives the confirm or Back event, creates the character and spawns it. You only need:
Config.useIdentityCreator = truein Multichar (the default).Config.callbackEventandConfig.backEventleft 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.
Standalone mode
Section titled “Standalone mode”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.luaConfig.selfHandle = trueConfig.callbackEvent = 'myscript:identityDone'-- your own resource, client sideAddEventHandler('myscript:identityDone', function(payload) -- the character now exists, continue your own flowend)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:
- Kivo Identity Creator (
Config.useIdentityCreator = true). - A built-in
ox_libdialog (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:
- In Kivo Multichar’s
config.lua, setConfig.useIdentityCreator = false. - Remove
ensure kivo-identity-creatorfromserver.cfg.
The built-in dialog does not ask for height or nationality. See Examples in the suite for the defaults that are saved.
Adapting to another framework
Section titled “Adapting to another framework”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.luaConfig = 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 = nilend-- config.luaConfig.fields.myfw = { firstname = true, lastname = true, dob = true, gender = true, height = false, nationality = false,}Adjusting fields without touching code
Section titled “Adjusting fields without touching code”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