forked from Simnation/Main
31 lines
1.3 KiB
Lua
31 lines
1.3 KiB
Lua
![]() |
-- NOTE: This has NOT been tested, may need to be fixed. Please let me know if this doesn't work!
|
||
|
|
||
|
---Sends a dispatch alert about the slashing of tires
|
||
|
---@param coords vector3
|
||
|
---@param vehicleNetId integer
|
||
|
local function sendDispatchAlert(coords, vehicleNetId)
|
||
|
local vehicle = NetToVeh(vehicleNetId)
|
||
|
local playerData = exports['qs-dispatch']:GetPlayerInfo()
|
||
|
local vehicleLabel = GetLabelText(GetDisplayNameFromVehicleModel(GetEntityModel(vehicle)))
|
||
|
local vehiclePlate = GetVehicleNumberPlateText(vehicle)
|
||
|
|
||
|
TriggerServerEvent('qs-dispatch:server:CreateDispatchCall', {
|
||
|
job = { 'police', 'sheriff', 'traffic', 'patrol' },
|
||
|
callLocation = coords,
|
||
|
callCode = { code = GetLocalization('dispatch_label'), snippet = "10-66" },
|
||
|
message = string.format("Street: %s Crossing Street: %s Sex: %s Vehicle: %s Vehicle Plate %s", playerData.street_1, playerData.street_2, playerData.sex, vehicleLabel, vehiclePlate),
|
||
|
flashes = false,
|
||
|
image = nil,
|
||
|
blip = {
|
||
|
sprite = 432,
|
||
|
scale = 1.0,
|
||
|
colour = 2,
|
||
|
flashes = false,
|
||
|
text = GetLocalization('dispatch_label'),
|
||
|
time = (60 * 1000), -- 60 seconds
|
||
|
}
|
||
|
})
|
||
|
end
|
||
|
|
||
|
RegisterNetEvent('slashtires:sendDispatchAlert', sendDispatchAlert)
|