Installation
Dependencies
QBCore Framework qb-input qb-menu ps-dispatch - (https://github.com/Project-Sloth/ps-dispatch)
How to install
Drag the script in your folder
Add the following item to yourinventory/data/items.lua
QBCore users to qbcore/shared/items.lua
Add the item image to your inventory/images
-- Chop Shop
['splaka'] = {['name'] = 'splaka', ['label'] = 'Fake Plate', ['weight'] = 150, ['type'] = 'item', ['image'] = 'plaka.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['airbag'] = {['name'] = 'airbag', ['label'] = 'AirBag', ['weight'] = 250, ['type'] = 'item', ['image'] = 'airbag.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['lowradio'] = {['name'] = 'lowradio', ['label'] = 'Low Quality Radio', ['weight'] = 350, ['type'] = 'item', ['image'] = 'lowradio.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['stockrim'] = {['name'] = 'stockrim', ['label'] = 'Low Quality Wheel', ['weight'] = 150, ['type'] = 'item', ['image'] = 'stockrim.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['highradio'] = {['name'] = 'highradio', ['label'] = 'High Quality Radio', ['weight'] = 250, ['type'] = 'item', ['image'] = 'highradio.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['highrim'] = {['name'] = 'highrim', ['label'] = 'High Quality Wheel', ['weight'] = 350, ['type'] = 'item', ['image'] = 'highrim.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['doors'] = {['name'] = 'doors', ['label'] = 'Doors', ['weight'] = 150, ['type'] = 'item', ['image'] = 'doors.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Kapılar'},
['speaker'] = {['name'] = 'speaker', ['label'] = 'Speaker', ['weight'] = 250, ['type'] = 'item', ['image'] = 'speaker.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['screwdriver'] = {['name'] = 'screwdriver', ['label'] = 'Screwdriver', ['weight'] = 250, ['type'] = 'item', ['image'] = 'screwdriver.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['battery'] = {['name'] = 'battery', ['label'] = 'Battery', ['weight'] = 250, ['type'] = 'item', ['image'] = 'battery.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['belt'] = {['name'] = 'screwdriver', ['label'] = 'Belt', ['weight'] = 250, ['type'] = 'item', ['image'] = 'belt.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['lockpick'] = {['name'] = 'lockpick', ['label'] = 'Lockpick', ['weight'] = 250, ['type'] = 'item', ['image'] = 'lockpick.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
Dispatch
First of all install ps-dispatch depending on your framework. You can find the links at the top.
QBCore
ps-dispatch/client/alerts
local function chopcar()
local coords = GetEntityCoords(cache.ped)
local vehicle = GetVehicleData(cache.vehicle)
local dispatchData = {
message = "Car smashing attempt",
codeName = 'Car chopping',
code = '10-13',
icon = 'fas fa-gun',
priority = 2,
vehicle = vehicle.name,
plate = vehicle.plate,
color = vehicle.color,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end exports('chopcar', chopcar)
ps-dispatch/shared/config.lua
['chopcar'] = {
radius = 0,
sprite = 110,
color = 1,
scale = 1.5,
length = 2,
sound = 'Lose_1st',
sound2 = 'GTAO_FM_Events_Soundset',
offset = false,
flash = false
},
ESX
ps-dispatch/client/cl_extraalerts
local function chopcar(vehicle)
local vehdata = vehicleData(vehicle)
local currentPos = GetEntityCoords(PlayerPedId())
local locationInfo = getStreetandZone(currentPos)
local gender = GetPedGender()
TriggerServerEvent("dispatch:server:notify",{
dispatchcodename = "carchop", -- has to match the codes in sv_dispatchcodes.lua so that it generates the right blip
dispatchCode = "10-13",
firstStreet = locationInfo,
gender = gender,
model = vehdata.name,
plate = vehdata.plate,
priority = 2,
firstColor = vehdata.colour,
automaticGunfire = false,
origin = {
x = currentPos.x,
y = currentPos.y,
z = currentPos.z
},
dispatchMessage = "Car smashing attempt", -- message
job = {"police"} -- jobs that will get the alerts
})
end exports('chopcar', chopcar)
ps-dispatch/server/sv_dispatchcodes
["carchop"] = {displayCode = '10-13', description = "Suspicious Activity", radius = 0, recipientList = {'police'}, blipSprite = 66, blipColour = 37, blipScale = 0.5, blipLength = 2, sound = "Lose_1st", sound2 = "GTAO_FM_Events_Soundset", offset = "false", blipflash = "false"},
Last updated