Multi Character integration

Since version 1.1.3 we added support for Multicharacer systems if you have Multichar system be sure to put Config.Multichar in JustBanks to true

Config.Multichar = true

After that in your Multichar system you have to trigger event from Config.lua ( JustBanks ) for example we will show on ESX_multichar

function Menu:PlayCharacter()
    Multicharacter:CloseUI()
    TriggerServerEvent("esx_multicharacter:CharacterChosen", Multicharacter.spawned, false)
    TriggerEvent("JustBanks:loadChar")
end

or if you want do manage it through server side

function Multicharacter:CharacterChosen(source, charid, isNew)
    if type(charid) ~= "number" or string.len(charid) > 2 or type(isNew) ~= "boolean" then
        return
    end

    if isNew then
        self.awaitingRegistration[source] = charid
    else
        SetPlayerRoutingBucket(source, 0)
        if not ESX.GetConfig().EnableDebug then
            local identifier = ("%s%s:%s"):format(Server.prefix, charid, ESX.GetIdentifier(source))

            if ESX.GetPlayerFromIdentifier(identifier) then
                DropPlayer(source, "[ESX Multicharacter] Your identifier " .. identifier .. " is already on the server!")
                return
            end
        end

        local charIdentifier = ("%s%s"):format(Server.prefix, charid)
        TriggerEvent("esx:onPlayerJoined", source, charIdentifier)
        ESX.Players[ESX.GetIdentifier(source)] = charIdentifier
    end
    
    TriggerClientEvent("JustBanks:loadChar", source)
end

Last updated