databaseDatabase Setup

This page explains the database tables used by 0r-multicharacterv3 and how to set them up.

๐Ÿ“Š Required Tables

Table: 0r_multicharacterv3

Stores additional character slot data for each player.

CREATE TABLE IF NOT EXISTS `0r_multicharacterv3` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `identifier` VARCHAR(100) NOT NULL,
    `character_slot` INT(11) NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`),
    UNIQUE KEY `identifier` (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Column
Type
Description

id

INT

Auto-increment primary key

identifier

VARCHAR(100)

Player's license2 identifier

character_slot

INT

Additional slots (added to default)

Table: 0r_multicharacterv3_code

Stores redeemable codes for extra character slots.

CREATE TABLE IF NOT EXISTS `0r_multicharacterv3_code` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `code` VARCHAR(100) NOT NULL,
    `slot` INT(11) NOT NULL DEFAULT 1,
    PRIMARY KEY (`id`),
    UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Column
Type
Description

id

INT

Auto-increment primary key

code

VARCHAR(100)

Unique redeemable code

slot

INT

Number of slots the code gives


๐Ÿš€ Quick Setup

Using the SQL File

  1. Locate insert-me.sql in the resource folder

  2. Open your database management tool

  3. Execute the entire SQL file

Manual Creation

Run these queries in your database:


๐ŸŽฎ Framework-Specific Tables

The script also interacts with your framework's existing tables:

QBCore / QBox

Table
Usage

players

Character data storage

playerskins

Character appearance

ESX

Table
Usage

users

Character data storage

(skin in users table)

Character appearance

circle-info

You don't need to modify framework tables. The script uses them as-is.


๐Ÿ  Optional: House Data (QBCore Only)

If you use qb-houses, the script reads from:

Make sure your houselocations table exists if using housing.


๐Ÿ”ง Character Deletion Tables

When a character is deleted, the script removes data from configured tables. Default tables in config/database.lua:

QBCore Tables

ESX Tables


๐Ÿ“ Adding Custom Codes

To add redeemable slot codes manually:

Players can redeem these codes in the character selection UI.

Last updated