Skip to content

Instructions

In this script, much of the logic you may need to modify resides in the open-source files named adapter.lua, which are present in both the client and server folders.

Here, we will discuss the significance of these events to provide you with a better understanding of what needs editing and modification for your server.

Commands

Below are the commands provided by the script that you can use to manage your server:

  • givecharslot (Admin Only)

    • Grants a character slot to a player.
    • Example: /givecharslot playerSource
  • logout (Admin Only)

    • Logs out the current character.
    • Example: /logout

Notifications

Many servers use custom notification systems. You can integrate your custom notification script by modifying the client event multicharacter->notify.

Here's how:

  1. Open the lua/client/adapter.lua file.
  2. Locate the multicharacter->notify event.
  3. Adapt the code to integrate your custom notification script.
lua
AddEventHandler('multicharacter->notify', function(src, message, messageType, title)
    --- Your custom notification code here
end)

Modifying Clothing Script

Modifying the clothing script utilized by this system entails a series of steps, but it's entirely feasible.

  1. Database Interaction:

    • The script relies on the skin column (playerskins table in illenium-appearance) to open the clothing menu if a character is missing skin. This functionality is encapsulated within the hasSkin(identifier, success, fail) function.
  2. Fetching Character Skin:

    • To retrieve the skin data of a specific character and transmit it to the client, the script uses the Adapter.FetchCharacterSkin(src, license, identifier, cb) method.
  3. Client Event: multicharacter->onSkinLookup:

    • This event triggers when a player clicks on a character and send request to retrieve the skin data.
  4. Client Skin Setter: multicharacter->setSkin:

    • Upon receiving skin information from the server, this event is responsible for applying the skin to the character model on the client side.
    lua
    AddEventHandler('multicharacter->setSkin', function(pedHandle, skinData)
        -- Insert your clothing script logic here
    
        -- Example:
        -- exports['illenium-appearance']:setPedAppearance(pedHandle, skinData)
    end)

By incorporating your custom clothing script within this event handler, you can seamlessly integrate personalized character appearances into your server.

Events & Interfaces

These events and interfaces allow you to customize and manage the character selection process in your server.

multicharacter->onCharacterLoad (event) (server)

  • Triggered when a player chooses a character.

multicharacter->onCreateCharacter (event) (server)

  • Triggered when a player finishes filling the registration form and presses confirm on the UI.

multicharacter->onDeleteCharacter (event) (server)

  • Triggered when a player presses confirm in the character deletion UI.

multicharacter->onSync (event) (server)

  • Triggered when a player loads into the UI or requests a UI refresh. You must respond to the client using the event multicharacter:client<-sync and send the character list to the client.
lua
AddEventHandler('multicharacter->onSync', function(src, license)
    local characters = {}
    local current_slots = 0

    TriggerEvent('multicharacter:client<-sync', src, characters, current_slots)
end)

multicharacter->onSkinLookup (event) (server)

  • Triggered when the client requests skin information. You must respond to it with the event multicharacter:client<-skin by sending the skin information to the client.
lua
AddEventHandler('multicharacter->onSkinLookup', function(src, license, identifier)
    local skin = {}
    TriggerEvent('multicharacter:client<-skin', src, skin)
end)

CharacterLoad (interface) (server)

  • Triggered when a player chooses a character.
lua
Interface.on('CharacterLoad', function(src, identifier, data, webhook)
    -- Your code here
end)

CreateCharacter (interface) (server)

  • Triggered when a player finishes filling the registration form and presses confirm on the UI.
lua
Interface.on('CreateCharacter', function(src, data, webhook)
    Interface.send('refresh', src)
end)

DeleteCharacter (interface) (server)

  • Triggered when a player presses confirm in the character deletion UI.
lua
Interface.on('DeleteCharacter', function(src, identifier, webhook)
    Interface.send('refresh', src)
end)

Sync (interface) (server)

  • Triggered when a player loads into the UI or requests a UI refresh. You must respond to the client using the event Interface.send('sync', src, data, slots) and send the character list to the client.
lua
Interface.on('Sync', function(src, identifier, webhook)
    Interface.send('sync', src, data, slots)
end)

SkinLookup (interface) (server)

  • Triggered when the client requests skin information. You must respond to it with the event Interface.send('skin', src, skin) by sending the skin information to the client.
lua
Interface.on('SkinLookup', function(src, license, identifier, webhook)
    Interface.send('skin', src, skin)
end)

If you have any questions or need assistance, feel free to join our Discord server: https://discord.gg/ccMArCwrPV