๐ 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#
- Locate
insert-me.sqlin the resource folder - Open your database management tool
- Execute the entire SQL file
Manual Creation#
Run these queries in your database:
-- Create character slot table
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;
-- Create redeemable codes table
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;
๐ฎ 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 |
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:
-- Used for house garage config
SELECT * FROM houselocations
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#
['qb-core'] = {
{ table = 'players', column = 'citizenid', type = 'citizenid' },
{ table = 'playerskins', column = 'citizenid', type = 'citizenid' },
{ table = 'player_vehicles', column = 'citizenid', type = 'citizenid' },
{ table = 'player_houses', column = 'citizenid', type = 'citizenid' },
{ table = 'player_gangs', column = 'citizenid', type = 'citizenid' },
-- Add more as needed
}
ESX Tables#
['es_extended'] = {
{ table = 'users', column = 'identifier', type = 'citizenid' },
{ table = 'user_accounts', column = 'identifier', type = 'citizenid' },
{ table = 'user_inventory', column = 'identifier', type = 'citizenid' },
-- Add more as needed
}
๐ Adding Custom Codes#
To add redeemable slot codes manually:
-- Add a single-use code that gives 1 slot
INSERT INTO 0r_multicharacterv3_code (code, slot) VALUES ('FREESLOT2024', 1);
-- Add a code that gives 3 slots
INSERT INTO 0r_multicharacterv3_code (code, slot) VALUES ('VIP3SLOTS', 3);
Players can redeem these codes in the character selection UI.