Step 4

Database installation

For this step, we always recommend making sure you have the latest version of mysql on your computer or dedicated server, with this we make sure that the import of the sql file works successfully.

To begin it is important to clean all the inventories of the players, that is, to restart the inventory of all your players, for that we will use the following sql which will do it automatically and will set the correct syntax for the inventory of each player:

UPDATE players SET inventory = '[]' WHERE citizenid IS NOT NULL;

Do not continue to the next step without running the sql we mentioned above this message, otherwise you will never be able to use the inventory correctly.

Once we take that into account, we will place the following sql in our database, you will also have this in a file inside the package that we downloaded in the first step.

CREATE TABLE IF NOT EXISTS `inventory_glovebox` (
  `id` int(11) NOT NULL AUTO_INCREMENT, 
  `plate` varchar(255) DEFAULT NULL, 
  `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, 
  PRIMARY KEY (`plate`), 
  KEY `id` (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = latin1;

CREATE TABLE IF NOT EXISTS `inventory_stash` (
  `id` int(11) NOT NULL AUTO_INCREMENT, 
  `stash` varchar(255) DEFAULT NULL, 
  `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, 
  PRIMARY KEY (`stash`), 
  KEY `id` (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = latin1;

CREATE TABLE IF NOT EXISTS `inventory_trunk` (
  `id` int(11) NOT NULL AUTO_INCREMENT, 
  `plate` varchar(255) DEFAULT NULL, 
  `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, 
  PRIMARY KEY (`plate`), 
  KEY `id` (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = latin1;

CREATE TABLE IF NOT EXISTS `inventory_metadata` (
  `id` INT(11) NOT NULL AUTO_INCREMENT, 
  `identifier` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci', 
  `data` TEXT NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci', 
  PRIMARY KEY (`id`) USING BTREE
) COLLATE = 'utf8mb4_unicode_ci' ENGINE = InnoDB;

CREATE TABLE IF NOT EXISTS `inventory_clothes` (
  `id` INT(11) NOT NULL AUTO_INCREMENT, 
  `identifier` VARCHAR(50) NOT NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', 
  `items` TEXT NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci', 
  PRIMARY KEY (`identifier`) USING BTREE, 
  INDEX `id` (`id`) USING BTREE
) COLLATE = 'utf8mb4_general_ci' ENGINE = InnoDB AUTO_INCREMENT = 6;

Last updated