To use this script, you also need the FORGE-CHARCREATOR, both are purchased together so you should have no problem installing them together.
This script is compatible with ESX, QB, QBOX and Illenium.
This script is compatible with Quasar Inventory, QB Inventory and OX Inventory.
INSTALLATION GUIDE
Download from KEYMASTER and Unzip the forge-multicharacter.pack.zip and place this folder in your server's resource folder.
Add the resource to your server start config: ensure forge-multicharacter,the name of the folder must not be changed or the resource will not function correctly. It should be located just below your core.
Delete or remove from your resources folder any other MultiCharacter you have, such as esx_multicharacter.
If you are ESX + Illenium you will also need to remove the following scripts: esx_skin, skinchanger.If you're using ESX + Default, do not delete this.
Go to es_extended config and enable MultiCharacter = true, even if you are only using 1 character slot. It should look like this:
You must install SQL, make sure you install the correct one, since there is one for ESX and another for QB.
If you want to use role detention, you have to create a discord bot and add it to your Discord server and correctly add the token and guild in the config. Follow thistutorial.
Remember that the bot configuration and Discord integration are done first in the sv_config.lua file and then in the config.lua.
Clear the cache of your server and also of your own FiveM.
Reboot the entire server with the forge script well ensured in your server.cfg.
Download from KEYMASTER and Unzip the forge-multicharacter.pack.zip and place this folder in your server's resource folder.
Add the resource to your server start config: ensure forge-multicharacter,the name of the folder must not be changed or the resource will not function correctly. It should be located just below your core.
Delete or remove from your resources folder any other MultiCharacter you have, such as qb-multicharacter.
If you're using QB-Core + Illenium, navigate to the following location:
illenium-apperance/client/framework/esx/compatibility.lua -> line 1(This can vary depending on the version you have, so, it's better to directly search for these functions and comment them out):
if not Framework.ESX() then return end
You must install SQL, make sure you install the correct one, since there is one for ESX and another for QB.
If you want to use role detention, you have to create a discord bot and add it to your Discord server and correctly add the token and guild in the config. Follow thistutorial.
Remember that the bot configuration and Discord integration are done first in the sv_config.lua file and then in the config.lua.
Clear the cache of your server and also of your own FiveM.
Reboot the entire server with the forge script well ensured in your server.cfg.
The script will work with QB functions. However, you still need to modify a few things in your QBOX, which you'll see below.
Keep in mind that you must select the QB framework and follow all the QB configuration steps along with the new changes for QBOX.
Download from KEYMASTER and Unzip the forge-multicharacter.pack.zip and place this folder in your server's resource folder.
Add the resource to your server start config: ensure forge-multicharacter,the name of the folder must not be changed or the resource will not function correctly. It should be located just below your core.
Delete or remove from your resources folder any other MultiCharacter you have, such as qbox-multicharacter.
If you're using QBOX-Core + Illenium, navigate to the following location:
illenium-apperance/client/framework/esx/compatibility.lua -> line 1(This can vary depending on the version you have, so, it's better to directly search for these functions and comment them out):
if not Framework.ESX() then return end
You also need to add something to your QBOX core: This is the function that need to add:
qbox_core > bridge > qb > server > player.lua
function playerObj.CreateCitizenId()
return exports['qbx_core']:GenerateUniqueIdentifier('citizenid')
end
With this change, everything should work without any issues. But if you still can't get it to work properly, do this as well:
You have to change license to license2 in function ST.QB:PRIMARY_IDENTIFIER()
forge-multicharacter/server/frameworks/QB.lua
You must install SQL, make sure you install the correct one, since there is one for ESX and another for QB.
If you want to use role detention, you have to create a discord bot and add it to your Discord server and correctly add the token and guild in the config. Follow thistutorial.
Remember that the bot configuration and Discord integration are done first in the sv_config.lua file and then in the config.lua.
Clear the cache of your server and also of your own FiveM.
Reboot the entire server with the forge script well ensured in your server.cfg.
CONFIG
The following will explain all the settings, one of the most important things that I recommend you spend a few minutes to understand in order to offer your users the best possible experience.
In addition, inside CLIENT and SERVER you will have the files related to the frameworks, where you will have many open ESX and QB functions for you to adapt them to your framework needs.
If you use the latest update of the script it will automatically detect everything regarding Framework, Skin Manager and Identifier. Don't touch anything where it says "You don't need to touch this".
Config = {}
Config.MULTICHAR = {}
Config.UI = {}
Config.UI.color = {}
-- βββββββ βββββββ ββββ ββββββββββββββ βββββββ βββ ββββββββββ ββββββ ββββββββββββ βββββββ ββββ βββ
-- ββββββββββββββββββββββ ββββββββββββββββββββββ βββ βββββββββββββββββββββββββββββββββββββββββββββ βββ
-- βββ βββ βββββββββ βββββββββ ββββββ βββββββ βββββββββββββββββββ βββ ββββββ βββββββββ βββ
-- βββ βββ βββββββββββββββββββ ββββββ ββββββ βββββββββββββββββββ βββ ββββββ βββββββββββββ
-- ββββββββββββββββββββ βββββββββ ββββββββββββββββββββββββ ββββββ βββ βββ βββββββββββββββ ββββββ
-- βββββββ βββββββ βββ ββββββββ βββ βββββββ βββββββ βββ ββββββ βββ βββ βββ βββββββ βββ βββββ
Config.DEBUG = true -- This will activate debug mode, with a bunch of LOGs on F8 that will corroborate the script's operation. Enable it only in necessary cases
-- GENERAL:
Config.framework = GetResourceState('es_extended') == "started" and "ESX" or GetResourceState('qb-core') == "started" and "QB" or "CUSTOM" -- You don't need to touch this
Config.resource = nil -- nil => default resource name, normally you don't need to change this value, only if you are using a custom ESX or QB version with a different resource name than 'es_extended' or 'qb-core'
--[[
~id~ = character id (ESX) / citizenid (QBCore)
~license~ = license identifier
~steam~ = steam identifier
~discord~ = discord identifier
default:
ESX: 'char~id~:~license~'
QB: '~id~'
]]
Config.Prefix = 'char' -- You don't need to touch this
Config.identifier = Config.framework == 'ESX' and 'char~id~:~license~' or '~id~' -- You don't need to touch this
Config.useIllenium = (GetResourceState("illenium-appearance") == "started" and true or false) -- You don't need to touch this
Config.lowPerformanceMode = false -- If you put true here. All UI animations will be removed, so there's no possible LAG. This lowers the aesthetics and beauty of the system
Config.particles = true -- If you put false here, it means there will be no particles or dark background. If you think it looks too dark when creating a character, set it to false here. This lowers the aesthetics and beauty of the system
Config.allowLogout = true -- if true, the player is allowed to logout, whithout having to quit and rejoin
Config.relogCommand = "relog" -- The command that can be used to do relog/logout
Config.relogAdmin = false -- if true, only admins can use the relog admin command on other players or themselves
Config.relogAdminCommand = "rp" -- Admin command to force relog on other players. Only if relogAdmin is true
Config.addSlotsCommand = "addslots" -- The command that can be used to add slots
--Dimensions that should not be used selecting the character.
---Dimension 0 is locked by default since this is the default server dimension with the city and players should not be visible during character selection.
Config.lockedDimensions = {
0, --- default server dimension
}
-- INTERFACE:
Config.UI.volume = 30 -- 0 - 100
Config.UI.color.primary = "0, 224, 255" -- primary UI color
Config.UI.color.secondary = "49, 175, 212" -- secondary UI color
Config.UI.color.hover = "0, 150, 196" -- hover UI color
-- DISCORD ROLES
Config.noDiscordSlots = 3 -- amount of slots unlocked, when no discord bot is connected.
Config.MULTICHAR.slots = { -- Each discord role will access the number of slots you want
{
groupId = "your-groupId",
name = "Premium",
slots = 3
},
{
groupId = "your-groupId",
name = "Premium+",
slots = 4
},
{
groupId = "1233795374641189018",
name = "Member",
slots = 2
},
}
Config.MULTICHAR.buy_new_slot_url = "https://discord.gg/my-server" -- Add the invitation link to your discord. When you want to purchase a new slot, this one will be opened
-- CHARACTER SETTINGS
Config.MULTICHAR.Animations = { -- When you select a character, the character will make an animation from this list
{
animation = "gestures@f@standing@casual gesture_hello",
time = 1000
},
{
animation = "gestures@m@standing@casual gesture_hello",
time = 1000
},
{
animation = "gestures@m@standing@fat gesture_hello",
time = 1000
}
}
Config.MULTICHAR.canDelete = true -- If true players are allowed to delete their characters. If false, they can only be deleted from the database
Config.MULTICHAR.spawn = vector4(-284.2856, 562.4627, 172.9182, 19.9895) -- The position, where the player will be while in the menu
-- TRANSLATES
Config.language = "en"
Language = {}
Language.en = {
['delete_character'] = "DELETE CHARACTER",
['playtime'] = "PLAYTIME",
['play'] = "PLAY",
['yes'] = "YES",
['no'] = "NO",
['you_sure'] = "ARE YOU SURE?",
['deleted'] = "Character deleted !",
['last_spawn'] = "Here is some information about this character the last spawn point was at ~lsp~", -- ~lsp~ = The players last location (Street [crossing Street])
['ls_citizien'] = "Los Santos - Citizien",
['gender'] = "Gender",
['gender_male'] = "MALE",
['gender_female'] = "FEMALE",
['job'] = "JOB",
['create_char'] = "CREATE A NEW CHARACTER",
['free'] = "FREE",
['create'] = "CREATE",
['buy_slot'] = "BUY A NEW CHARACTER SLOT",
['please_restart'] = "To do this, you must perform a full restart.",
['charcard_gender'] = "GENDER",
['cash'] = "CASH",
['bank'] = "BANK",
['nationality'] = "NATIONALITY",
['select'] = "SELECT",
['please_wait'] = "PLEASE WAIT..."
}
Language.de = {
['delete_character'] = "CHARACTER LΓSCHEN",
['playtime'] = "SPIELZEIT",
['play'] = "SPIELEN",
['yes'] = "JA",
['no'] = "NEIN",
['you_sure'] = "BIST DU DIR SICHER?",
['deleted'] = "Character gelΓΆscht!",
['last_spawn'] = "Hier sind ein paar information ΓΌber den character. Die letze position war bei ~lsp~", -- ~lsp~ = The players last location (Street [crossing Street])
['ls_citizien'] = "Los Santos - BΓΌrger",
['gender'] = "Gender",
['gender_male'] = "MΓNNLICH",
['gender_female'] = "WEIBLICH",
['job'] = "BERUF",
['create_char'] = "NEUEN CHARACTER ERSTELLEN",
['free'] = "FREI",
['create'] = "ERSTELLEN",
['buy_slot'] = "NEUEN SLOT KAUFEN",
['please_restart'] = "Um diese aktion auszufΓΌhren, musst du dein spiel neu starten.",
['charcard_gender'] = "GESCHLECHT",
['cash'] = "BARGELD",
['bank'] = "BANK",
['nationality'] = "NATIONALITΓT",
['select'] = "AUSWΓHLEN",
['pease_wait'] = "BITTE WARTE..."
}
Config.bot = { -- Add your discord bot information. This detects whether a player has the necessary role to access a slot or not. More information in the documentation
guild = "your-guild",
token = "your-token",
use = false -- set this to false if you don't want to use the discord bot
}
Open = {}
Open.client = {}
---Called, when the player clicked on play. This should open the spawn menu, if exists.<br>
---Scripts using ESX or QBCore default functions, are included by default.
function Open.client:openSpawnMenu() end
---Should call an export on the hud to hide the hud
---@param bool boolean if set to true, the hud should be hidden, if not the hud should be visible
function Open.client:hideHud(bool) end
---Forces the UI to stay hidden or not<br>
---can be used with `exports["forge-multicharacter"]:forceHide(true)` or `exports["forge-multicharacter"]:forceHide(false)`
---@param hide boolean if set to true the UI will be hidden, if not the UI will be visible, IF the UI would be visibile in the current situation
exports("forceHide", function(hide)
UI.forceHide(hide)
end)
QB
ALTER TABLE `players` ADD `playtime` BIGINT NOT NULL DEFAULT '0' AFTER `last_updated`;
CREATE TABLE additionalSlots (
`identifier` VARCHAR(64) NOT NULL,
`slots` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`identifier`)
);
ESX
ALTER TABLE `users` ADD `playtime` BIGINT NOT NULL DEFAULT '0' AFTER `pincode`;
ALTER TABLE `users` ADD `nationality` VARCHAR(50) DEFAULT 'UNKNOWN' AFTER `playtime`;
CREATE TABLE additionalSlots (
`identifier` VARCHAR(64) NOT NULL,
`slots` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`identifier`)
);
If you want to edit the aesthetics or design. You have the HTML open so you can modify the style and everything as you want.
The script is RESPONSIVE for all resolutions as well.