fix(dispatch): update vehicle color in SendAlert function
This commit is contained in:
1 parent
5957a887a2
commit
f8777d3a90
1 file changed
+6
-1
@@ -3,6 +3,11 @@ if GetResourceState('origen_police') == 'missing' then return end
|
|||||||
Dispatch = Dispatch or {}
|
Dispatch = Dispatch or {}
|
||||||
|
|
||||||
Dispatch.SendAlert = function(data)
|
Dispatch.SendAlert = function(data)
|
||||||
|
local color = nil
|
||||||
|
if data.vehicle then
|
||||||
|
local r, g, b = GetVehicleColor(data.vehicle)
|
||||||
|
color = {r, g, b}
|
||||||
|
end
|
||||||
local customData = {
|
local customData = {
|
||||||
coords = data.coords or vector3(0.0, 0.0, 0.0),
|
coords = data.coords or vector3(0.0, 0.0, 0.0),
|
||||||
title = 'Alert '..(data.code or '10-80'),
|
title = 'Alert '..(data.code or '10-80'),
|
||||||
@@ -10,7 +15,7 @@ Dispatch.SendAlert = function(data)
|
|||||||
job = data.jobs or 'police',
|
job = data.jobs or 'police',
|
||||||
metadata = {
|
metadata = {
|
||||||
model = data.vehicle and (GetDisplayNameFromVehicleModel(GetEntityModel(data.vehicle))) or nil,
|
model = data.vehicle and (GetDisplayNameFromVehicleModel(GetEntityModel(data.vehicle))) or nil,
|
||||||
color = {255, 255, 255},
|
color = color,
|
||||||
plate = data.vehicle and GetVehicleNumberPlateText(data.vehicle) or nil,
|
plate = data.vehicle and GetVehicleNumberPlateText(data.vehicle) or nil,
|
||||||
speed = data.vehicle and (GetEntitySpeed(veh) * 3.6)..' kmh' or nil
|
speed = data.vehicle and (GetEntitySpeed(veh) * 3.6)..' kmh' or nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user