FAQ
Frequently Asked Questions
Error: 150 “Foreign key constraint is incorrectly formed”
This is an error you are likely to see on if you only have t1ger_tuning script and is trying to run the database query for t1ger_tunershops.
Open
main.sqllocated insidet1ger_tuning/install.Run this SQL in your database
-- ONLY RUN THIS IF YOU DO NOT HAVE t1ger_mechanic TABLE ALREADY!!
CREATE TABLE IF NOT EXISTS `t1ger_mechanic` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NOT NULL,
`job` LONGTEXT NOT NULL DEFAULT ('[]'),
`blip` LONGTEXT NOT NULL DEFAULT ('[]'),
`owner` VARCHAR(100) DEFAULT NULL,
`account` INT(11) NOT NULL DEFAULT 0,
`employees` LONGTEXT NOT NULL DEFAULT ('[]'),
`markers` LONGTEXT NOT NULL DEFAULT ('[]'),
`billing` LONGTEXT NOT NULL DEFAULT ('[]'),
`for_sale` TINYINT(1) NOT NULL DEFAULT 0,
`sale_price` INT(11) DEFAULT NULL,
`type` ENUM('mechanic', 'tuner', 'combined') NOT NULL DEFAULT 'mechanic',
PRIMARY KEY (`id`)
);Refresh the database
Then run this SQL in your database:
DROP TABLE IF EXISTS `t1ger_tunershops`;
CREATE TABLE `t1ger_tunershops` (
`shop_id` INT(11) NOT NULL, -- FK to t1ger_mechanic.id
`markup` INT(11) NOT NULL DEFAULT 0, -- % markup for upgrades
`categories` LONGTEXT NOT NULL DEFAULT ('[]'), -- Available upgrade categories
`delivery` LONGTEXT DEFAULT NULL, -- Delivery settings as JSON
`is_combined` TINYINT(1) NOT NULL DEFAULT 0, -- 1 = combined with mechanic
PRIMARY KEY (`shop_id`),
FOREIGN KEY (`shop_id`) REFERENCES `t1ger_mechanic`(`id`) ON DELETE CASCADE
);Restart your server and you'll be fine.
Failed to insert job
This is an error you are likely to see on es_extended when creating shops/jobs in runtime. All you have to do is:
Open
createJob.lualocated insidees_extended/server/modules. If you do not have acreateJob.luafile or modules folder, then openfunctions.luainsidees_extended/server.Locate the function named:
ESX.CreateJob.Replace the entire function with the following code:
Restart your server
Last updated