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:
- Open the
lua/client/adapter.lua
file. - Locate the
multicharacter->notify
event. - Adapt the code to integrate your custom notification script.
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.
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 thehasSkin(identifier, success, fail)
function.
- The script relies on the
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.
- To retrieve the skin data of a specific character and transmit it to the client, the script uses the
Client Event: multicharacter->onSkinLookup:
- This event triggers when a player clicks on a character and send request to retrieve the skin data.
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.
luaAddEventHandler('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.
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.
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.
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.
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.
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.
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.
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