Inside the same file, navigate to the cfg.items section and add the following code to the table:
["tracker_cartridge"] = {"Tracker Cartridge","Cartridge for Police Tracker.",function(args) return starChaseReload end,0.1}
Next, 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:
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