Item Support
The default item name for the GPS cartridge is "tracker_cartridge" and can be customised in the config.lua file.
Please note that your resource folder should be named 'policetracker' for our exports to work properly
vRP Item Support
Add the following line of code into your vrp/cfg/items.lua file:
local trackerReload = {}
local trackerItem = {}
trackerReload["Load"] = {function(player,choice)
local user_id = vRP.getUserId(player)
if user_id ~= nil then
TriggerEvent("Server:ReloadStarchase", player)
end
end}
trackerItem["Use"] = {function(player,choice)
local user_id = vRP.getUserId(player)
if user_id ~= nil then
TriggerEvent("Server:StarChaseWithItem", player)
end
end}
["tracker_cartridge"] = {"Tracker Cartridge","Cartridge for Tracker.",function(args) return trackerReload end,0.1}
["tracker"] = {"Tracker","Tracker",function(args) return trackerItem end,0.1}
ESX Item Support
Run the following SQL into your ESX database to add the item:
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('tracker', 'Tracker', 1, 0, 1),
('tracker_cartridge', 'Tracker Cartridge', 1, 0, 1);
QBCore Item Support
Add the following lines of code into your qb-core/shared/items.lua file:
tracker_cartridge = {
name = 'tracker_cartridge',
label = 'Tracker Cartridge',
weight = 1500,
type = 'item',
image = nil,
unique = false,
useable = true,
shouldClose = true,
combinable = nil,
description = 'Ammo for the tracker'
},
tracker = {
name = 'tracker',
label = 'Tracker',
weight = 1500,
type = 'item',
image = nil,
unique = false,
useable = true,
shouldClose = true,
combinable = nil,
description = 'Tracker'
},
Feel free to adjust the various item settings depending on your server requirements!
Ox_Inventory
The following code needs to be added into ox_inventory/data/items.lua within your OX_Inventory resource:
['tracker_cartridge'] = {
label = 'Tracker Cartridge',
weight = 220,
server = {
export = 'policetracker.OxUseTrackerDart',
},
},
['tracker'] = {
label = 'Tracker',
weight = 220,
server = {
export = 'policetracker.OxUseTracker',
},
},
Additionally, you'll need to open the config.lua file within the Police Tracker resource and navigate to lines 49-52.
cartridgeItemName = "tracker_cartridge", -- If you're using a framework, you'll need to add this as an item. See our documentation for more info on this.
starChaseItemName = "tracker",
oxInventory = false,
Here you can enable the items and also choose the names.
Core Inventory
Register the items within your inventory as necessary, with the exports seen below in the Quasar Inventory section.
Quasar Inventory
Add the following items to Quasar Inventory:
['tracker_cartridge'] = {
name = 'tracker_cartridge',
label = 'Tracker Cartridge',
weight = 5,
type = 'item',
unique = true,
useable = true,
description = 'Tracker Cartridge',
client = {
export = 'policetracker.quasarUseCartridge',
removeAfterUse = true,
},
},
['tracker'] = {
name = 'tracker',
label = 'Tracker',
weight = 5,
type = 'item',
unique = true,
useable = true,
description = 'Tracker',
client = {
export = 'policetracker.quasarUseTracker',
removeAfterUse = true,
},
}
Last updated
Was this helpful?