QBOX Installation

Step 1: Inventory Items

Navigate to your qb-core/shared/items.lua file and add the following items to your codebase:

-- Gang System Items
["bpcombatpdw"] = {
    label = "Combat PDW",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon",
    client = {
        image = "bpcombatpdw.png",
    }
},
["bpcombatpistol"] = {
    label = "Combat Pistol",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon",
    client = {
        image = "bpcombatpistol.png",
    }
},
["bpmachinepistol"] = {
    label = "Machine Pistol",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon",
    client = {
        image = "bpmachinepistol.png",
    }
},
["bpmicrosmg"] = {
    label = "Micro SMG",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon",
    client = {
        image = "bpmicrosmg.png",
    }
},
["bpminismg"] = {
    label = "Mini SMG",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon",
    client = {
        image = "bpminismg.png",
    }
},
["bppistol"] = {
    label = "Pistol",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon",
    client = {
        image = "bppistol.png",
    }
},
["bppistol50"] = {
    label = "Pistol .50",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon",
    client = {
        image = "bppistol50.png",
    }
},
["bpsnspistol"] = {
    label = "SNS Pistol",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon",
    client = {
        image = "bpsnspistol.png",
    }
},
["bpsmallscope_attachment"] = {
    label = "Small Scope",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon attachment",
    client = {
        image = "bpsmallscope_attachment.png",
    }
},
["bpclip_attachment"] = {
    label = "Extended Clip",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon attachment",
    client = {
        image = "bpclip_attachment.png",
    }
},
["bpdrum_attachment"] = {
    label = "Drum Clip",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon attachment",
    client = {
        image = "bpdrum_attachment.png",
    }
},
["bpflashlight_attachment"] = {
    label = "Flashlight",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon attachment",
    client = {
        image = "bpflashlight_attachment.png",
    }
},
["bpsuppressor_attachment"] = {
    label = "Suppressor",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon attachment",
    client = {
        image = "bpsuppressor_attachment.png",
    }
},
["bpgrip_attachment"] = {
    label = "Grip",
    weight = 0,
    stack = false,
    close = true,
    description = "A Blueprint for crafting a weapon attachment",
    client = {
        image = "bpgrip_attachment.png",
    }
},

-- Gang System Drugs
["weed_brick"] = {
    label = "Weed Brick",
    weight = 1000,
    stack = true,
    close = true,
    description = "1KG Weed Brick to sell to large customers.",
    client = {
        image = "weed_brick.png",
    }
},
["coke_brick"] = {
    label = "Coke Brick",
    weight = 1000,
    stack = false,
    close = true,
    description = "Heavy package of cocaine, mostly used for deals and takes a lot of space",
    client = {
        image = "coke_brick.png",
    }
},
["meth_brick"] = {
    label = "Meth Brick",
    weight = 1000,
    stack = false,
    close = true,
    description = "A kilo of Meth",
    client = {
        image = "meth_brick.png",
    }
},
["heroin_brick"] = {
    label = "Heroin Brick",
    weight = 1000,
    stack = false,
    close = true,
    description = "A kilo of Heroin",
    client = {
        image = "heroin_brick.png",
    }
},
            



Step 2: Inventory Images

Inventory images are included with the resource. Extract the images from the images folder and place them in the folder that contains the rest of your inventory images.




Step 3: Database Setup

CREATE TABLE IF NOT EXISTS `gangs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tag` varchar(10) NOT NULL,
`name` varchar(32) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`balance` int(11) NOT NULL DEFAULT 0,
`home_turf` varchar(255) DEFAULT NULL,
`last_blueprint` int(20) DEFAULT 0,
`last_gift` int(20) DEFAULT 0,
`last_home_turf` int(20) DEFAULT 0,
`penalty` int(20) DEFAULT 0,
`last_bm_shop` int(20) DEFAULT 0,
`storage` varchar(50) DEFAULT NULL,
`boss_menu` varchar(50) DEFAULT NULL,
`color` int(11) DEFAULT 0,
`purchased_hints` varchar(255) DEFAULT '[]',
`ranks` varchar(255) DEFAULT ' Prospect, Member, Enforcer, Treasurer, Sergeant at Arms, Vice President, President',
`image` varchar(255) DEFAULT NULL,
`leader_cid` varchar(50) DEFAULT NULL,
`last_active` varchar(50) DEFAULT NULL,
`war` int(20) DEFAULT 0,
`warOutfit` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'NA',
`prevalence` int(11) DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `gangs_ui_tag` (`tag`),
UNIQUE KEY `gangs_ui_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS `gang_perms` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`gang_id` int(11) NOT NULL,
`add_money_perms` varchar(255) DEFAULT '[]',
`remove_money_perms` varchar(255) DEFAULT '[]',
`declare_turf_perms` varchar(255) DEFAULT '[]',
`move_gang_storage` varchar(255) DEFAULT '[]',
`access_storage` varchar(50) DEFAULT '[]',
`add_members` varchar(50) DEFAULT '[]',
`rename_gang` varchar(50) DEFAULT '[]',
`manage_ranks` varchar(50) DEFAULT '[]',
`change_color` varchar(255) DEFAULT '[]',
PRIMARY KEY (`id`),
KEY `gang_id` (`gang_id`),
CONSTRAINT `gang_perms_ibfk_1` FOREIGN KEY (`gang_id`) REFERENCES `gangs` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS `gang_rivalries` (
`zone` varchar(255) DEFAULT NULL,
`escrow` int(11) DEFAULT NULL,
`competition` varchar(255) DEFAULT '[]',
`started` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS `gang_wars` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `declareeGangID` int(11) NOT NULL,
  `declareeGangName` varchar(50) DEFAULT NULL,
  `gangID` int(11) NOT NULL,
  `gangName` varchar(50) DEFAULT NULL,
  `warType` varchar(50) NOT NULL,
  `zone` varchar(50) DEFAULT NULL,
  `startTime` int(11) NOT NULL,
  `endTime` int(11) NOT NULL,
  `warStatus` varchar(20) DEFAULT 'Active',
  `declareeScore` int(11) DEFAULT 0,
  `gangScore` int(11) DEFAULT 0,
  `surrenderGang` int(11) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

CREATE TABLE IF NOT EXISTS `gang_zones` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(16) NOT NULL,
`gang_id` int(11) NOT NULL,
`loyalty` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `gang_zones_fk_id` (`gang_id`),
CONSTRAINT `gang_zones_fk_id` FOREIGN KEY (`gang_id`) REFERENCES `gangs` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=925 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;



Step 4: Ambulance Job Edits

Replace the following events inside your qb-ambulancejob/client/laststand.lua file near Line 114

---@param bool boolean
---TODO: this event name should be changed within qb-policejob to be generic
AddEventHandler('hospital:client:SetEscortingState', function(bool)
    LocalPlayer.state:set('isEscorted', bool)
    isEscorting = bool
end)