⚙️Integration

Item creation

If you don't want to use the command, you can use a tablet item instead.

Add the following lines to to qb-core/shared/items.lua

qb-core/shared/items.lua
['choptablet'] = { ['name'] = 'choptablet', ['label'] = 'Chop tablet', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'choptablet.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = "There is an app on that."},
weapon_hackingdevice   = { name = 'weapon_hackingdevice', label = 'Hacking Device', weight = 1000, type = 'weapon', ammotype = nil, image = 'hackingdevice.png', unique = true, useable = false, description = 'A device to hack' },
weapon_digiscanner     = { name = 'weapon_digiscanner', label = 'Scanning Device', weight = 1000, type = 'weapon', ammotype = nil, image = 'digiscanner.png', unique = true, useable = false, description = 'You scan with this' },
    

Add the image file to qb-inventory/html/images/choptablet.png

Add the image file to qb-inventory/html/images/hackingdevice.png

Add the image file to qb-inventory/html/images/digiscanner.png

Add the following code to the end of public\api\sv_framework.lua

public\api\sv_framework.lua
QBCore.Functions.CreateUseableItem("choptablet", function(source, item)
  TriggerClientEvent("kub_chop:client:openTablet", source)
end)

After you have successfully added the item you can disable the command by setting commandsEnabled to false in public\config\client\cl_config.lua

public\config\client\cl_config.lua
commandsEnabled = false,

Police dispatch calls

If you wish police to receive dispatch calls / notifications when contracts with gate hacking are being done.

In public\api\cl_framework.lua, change the alertPolice function to this

public\api\cl_framework.lua
function alertPolice(vehicleNetId, activeContract, type)
  if type == 'gateHackFinished' then
    local coords = vector3(activeContract.contract.vehicle_location.x, activeContract.contract.vehicle_location.y, activeContract.contract.vehicle_location.z)
    local vehicle = NetworkGetEntityFromNetworkId(vehicleNetId)
    local vehicleClass = activeContract.contract.vehicle_class
    exports["ps-dispatch"]:CustomAlert({
      coords = coords,
      message = "Vehicle is being stolen",
      dispatchCode = "10-35A",
      description = 'Vehicle stolen',
        radius = 0,
        plate = ('%s (%s class)'):format(GetVehicleNumberPlateText(vehicle), vehicleClass),
        sprite = 523,
        color = 5,
        scale = 1.5,
        length = 3,
    })
    return
  end
end

Last updated