Skip to content

Multicharacter — Editable Files (Server) ​

The whole bridge/ folder is open (not escrowed). Keep your copy when you update.

FileWhat it is for
bridge/hooks/server.luaYour own rules: stop or change actions, react to events
bridge/starter.luaItems a new character gets at its first spawn
bridge/inventory.luaHow starter items are given (add your inventory here)
bridge/delete.luaExtra tables to clean when a character is deleted
bridge/logs.luaDiscord webhook for deletes and new characters
bridge/housing/<script>/server.luaOne folder per housing script (Supported Scripts)
bridge/appearance/<script>/server.luaOne folder per appearance script (Supported Scripts)
bridge/framework/<esx, qbcore, qbox>/server.luaThe framework code, if your framework is modified
bridge/spawns.luaThe GTA places the admin menu offers with Add GTA places
bridge/scenes.luaThe built-in select scene
bridge/themes.luaThe menu themes

Hooks — bridge/hooks/server.lua ​

before.<name>(data) runs before something happens. return false stops it, return false, 'Text' stops it and shows the player the text. You may change the fields marked changeable.

HookdataChangeable
openSelectsource, account—
slotssource, account, slotsslots
selectDatasource, account, characterscharacters (add fields, hide characters)
playsource, account, id, character—
createsource, account, slot, detailsdetails (names, dob, sex, height, nationality)
deletesource, id, admin—
spawnDatasource, id, isNew, last, homes, placeshomes, places (add your own places)
spawnsource, id, isNew, place, positionposition
starterItemssource, id, itemsitems
adminActionsource, action, payload—

after.<event>(data) runs after something happened: selectOpened, created, loaded, deleted, unloaded, died. Each is also sent as the server event fwb_multicharacter:<event>.

lua
-- A police character can only be played by players with the police ACE
function before.play(data)
    if data.character.jobName == 'police' and not IsPlayerAceAllowed(data.source, 'group.police') then
        return false, 'Ask a supervisor to unlock this character.'
    end
    return true
end

Starter items — bridge/starter.lua ​

lua
StarterItems = {
    useFrameworkList = true, -- QBCore / Qbox: also give QBCore.Shared.StarterItems
    items = {
        { item = 'phone', count = 1 },
        { item = 'id_card', count = 1, metadata = function(c) return { firstname = c.firstname, lastname = c.lastname } end },
    },
}

Given once, when the new character first stands in the world. ESX already gives its own Config.StartingInventoryItems; keep only one of the two lists. StarterItems.forCharacter(character) can give different items per character.


Deleting characters — bridge/delete.lua ​

The framework removes its own rows. Tables of other scripts that keep the character under a different column are listed here:

lua
CharacterDelete = {
    tables = {
        { table = 'my_phone_messages', column = 'citizenid' },
    },
}

function CharacterDelete.after(id, info)
    exports['my-phone']:DeleteNumber(id)
end

Every delete is written to the table fwb_multicharacter_deletes (who, by whom, why, when).


Discord logs — bridge/logs.lua ​

lua
Logs = {
    webhook = 'https://discord.com/api/webhooks/...', -- empty = off
    deletes = true,
    created = false,
}

Adding a housing or appearance script ​

Copy bridge/housing/_template or bridge/appearance/_template, rename the folder to the script's name, and fill it in. The template explains every line. Restart: the admin menu lists it, and nothing else needs editing.

FWB Studio documentation.