Please note that your resource folder should be named 'policeshields' for our exports to work properly
ESX Item Support
Firstly, head to the config.lua file and enable ESX in the config. Next, run the following SQL into your ESX database to add the item:
Copy INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('firearms', 'Firearms Shield', 1, 0, 1),
('ctsfo', 'CTSFO Shield', 1, 0, 1),
('small', 'Small Shield', 1, 0, 1),
('long', 'Long Shield', 1, 0, 1),
('ctsfo2', 'CTSFO2 Shield', 1, 0, 1),
('firearms2', 'Firearms2 Shield', 1, 0, 1),
('long2', 'Long2 Shield', 1, 0, 1),
('short2', 'Short2 Shield', 1, 0, 1);
OX Inventory
Please note that your resource folder should be named 'policeshields' for our exports to work properly
The following code needs to be added into ox_inventory/data/items.lua within your OX_Inventory resource:
Copy ['firearms'] = {
label = 'Firearms Shield',
weight = 220,
server = {
export = 'policeshields.usePoliceShield',
name = "Firearms"
},
},
['ctsfo'] = {
label = 'CTSFO Shield',
weight = 220,
server = {
export = 'policeshields.usePoliceShield',
name = "CTSFO"
},
},
['small'] = {
label = 'Small Shield',
weight = 220,
server = {
export = 'policeshields.usePoliceShield',
name = "Small"
},
},
['long'] = {
label = 'Long Shield',
weight = 220,
server = {
export = 'policeshields.usePoliceShield',
name = "Long"
},
},
['ctsfo2'] = {
label = 'CTSFO2 Shield',
weight = 220,
server = {
export = 'policeshields.usePoliceShield',
name = "CTSFO2"
},
},
['firearms2'] = {
label = 'Firearms2 Shield',
weight = 220,
server = {
export = 'policeshields.usePoliceShield',
name = "Firearms2"
},
},
['long2'] = {
label = 'Long2 Shield',
weight = 220,
server = {
export = 'policeshields.usePoliceShield',
name = "Long2"
},
},
['short2'] = {
label = 'Short2 Shield',
weight = 220,
server = {
export = 'policeshields.usePoliceShield',
name = "Short2"
},
},
QB-Core Item Support
Firstly, head to the config.lua file and enable QBCore in the config. Next, add the following lines of code into your qb-core/shared/items.lua file:
Copy ['firearms'] = {
['name'] = 'firearms',
['label'] = 'Firearms Shield',
['weight'] = 1500,
['type'] = 'item',
['image'] = nil,
['unique'] = false,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Shield'
},
['ctsfo'] = {
['name'] = 'ctsfo',
['label'] = 'CTSFO Shield',
['weight'] = 1500,
['type'] = 'item',
['image'] = nil,
['unique'] = false,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Shield'
},
['small'] = {
['name'] = 'small',
['label'] = 'Small Shield',
['weight'] = 1500,
['type'] = 'item',
['image'] = nil,
['unique'] = false,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Shield'
},
['long'] = {
['name'] = 'long',
['label'] = 'Long Shield',
['weight'] = 1500,
['type'] = 'item',
['image'] = nil,
['unique'] = false,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Shield'
},
['ctsfo2'] = {
['name'] = 'ctsfo2',
['label'] = 'CTSFO2 Shield',
['weight'] = 1500,
['type'] = 'item',
['image'] = nil,
['unique'] = false,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Shield'
},
['firearms2'] = {
['name'] = 'firearms2',
['label'] = 'Firearms2 Shield',
['weight'] = 1500,
['type'] = 'item',
['image'] = nil,
['unique'] = false,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Shield'
},
['long2'] = {
['name'] = 'long2',
['label'] = 'Long2 Shield',
['weight'] = 1500,
['type'] = 'item',
['image'] = nil,
['unique'] = false,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Shield'
},
['short2'] = {
['name'] = 'short2',
['label'] = 'Short2 Shield',
['weight'] = 1500,
['type'] = 'item',
['image'] = nil,
['unique'] = false,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Shield'
},
Feel free to adjust the various item settings depending on your server requirements!
vRP Inventory Support
Firstly, head to the config.lua file and enable vRP in the config. Next, add the following line of code into your vrp/cfg/items.lua file:
Copy ["firearms"] = {"Shield","Shield",function(args) return gen("Firearms") end,0.1},
["ctsfo"] = {"Shield","Shield",function(args) return gen("CTSFO") end,0.1},
["small"] = {"Shield","Shield",function(args) return gen("Small") end,0.1},
["long"] = {"Shield","Shield",function(args) return gen("Long") end,0.1},
["ctsfo2"] = {"Shield","Shield",function(args) return gen("CTSFO2") end,0.1},
["firearms2"] = {"Shield","Shield",function(args) return gen("Firearms2") end,0.1},
["long2"] = {"Shield","Shield",function(args) return gen("Long2") end,0.1},
["short2"] = {"Shield","Shield",function(args) return gen("Short2") end,0.1},
local function gen(shieldType)
local fgen = function(args)
choices["Use"] = {function(player,choice)
local user_id = vRP.getUserId(player)
if user_id ~= nil then
TriggerEvent("Server:useVRPShield", player, shieldType)
end
end}
return choices
end
return fgen
end
Quasar Inventory Support
Quasar Inventory support is built into the resource. To start, head to the config.lua file and enable Quasar Inventory support within the resource.
We've done the rest for you and ensured that our Quasar Inventory support works for QBCore or ESX servers, so make sure you've also enabled QBCore or ESX within the config.lua file.
Copy ['firearms'] = {
name = 'firearms',
label = 'firearms',
weight = 5,
type = 'item',
unique = true,
useable = true,
description = 'Firearms',
client = {
export = 'policeshields.inventorySetupShield',
removeAfterUse = true,
},
},
['ctsfo'] = {
name = 'ctsfo',
label = 'firearms',
weight = 5,
type = 'item',
unique = true,
useable = true,
description = 'ctsfo',
client = {
export = 'policeshields.inventorySetupShield',
removeAfterUse = true,
},
},
['small'] = {
name = 'small',
label = 'small',
weight = 5,
type = 'item',
unique = true,
useable = true,
description = 'small',
client = {
export = 'policeshields.inventorySetupShield',
removeAfterUse = true,
},
},
['long'] = {
name = 'long',
label = 'long',
weight = 5,
type = 'item',
unique = true,
useable = true,
description = 'long',
client = {
export = 'policeshields.inventorySetupShield',
removeAfterUse = true,
},
},
['ctsfo2'] = {
name = 'ctsfo2',
label = 'ctsfo2',
weight = 5,
type = 'item',
unique = true,
useable = true,
description = 'ctsfo2',
client = {
export = 'policeshields.inventorySetupShield',
removeAfterUse = true,
},
},
['firearms2'] = {
name = 'firearms2',
label = 'firearms2',
weight = 5,
type = 'item',
unique = true,
useable = true,
description = 'Firearms2',
client = {
export = 'policeshields.inventorySetupShield',
removeAfterUse = true,
},
},
['long2'] = {
name = 'long2',
label = 'long2',
weight = 5,
type = 'item',
unique = true,
useable = true,
description = 'long2',
client = {
export = 'policeshields.inventorySetupShield',
removeAfterUse = true,
},
},
['short2'] = {
name = 'short2',
label = 'short2',
weight = 5,
type = 'item',
unique = true,
useable = true,
description = 'short2',
client = {
export = 'policeshields.inventorySetupShield',
removeAfterUse = true,
},
},
Core Inventory Support
Configure the items as necessary for core inventory