mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 00:16:27 +02:00
Plate text colour change and reduced changePlate call
This commit is contained in:
17
cl_radar.lua
17
cl_radar.lua
@@ -106,10 +106,18 @@ READER.vars =
|
||||
}
|
||||
}
|
||||
|
||||
function READER:GetPlate( cam )
|
||||
return self.vars[cam].plate
|
||||
end
|
||||
|
||||
function READER:SetPlate( cam, plate )
|
||||
self.vars.cams[cam].plate = plate
|
||||
end
|
||||
|
||||
function READER:GetIndex( cam )
|
||||
return self.vars[cam].index
|
||||
end
|
||||
|
||||
function READER:SetIndex( cam, index )
|
||||
self.vars.cams[cam].index = index
|
||||
end
|
||||
@@ -139,10 +147,12 @@ function READER:Main()
|
||||
|
||||
local cam = self:GetCamFromNum( i )
|
||||
|
||||
self:SetPlate( cam, plate )
|
||||
self:SetIndex( cam, index )
|
||||
if ( self:GetPlate( cam ) ~= plate ) then
|
||||
self:SetPlate( cam, plate )
|
||||
self:SetIndex( cam, index )
|
||||
|
||||
SendNUIMessage( { _type = "changePlate", cam = cam, plate = plate, index = index } )
|
||||
SendNUIMessage( { _type = "changePlate", cam = cam, plate = plate, index = index } )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -156,6 +166,7 @@ Citizen.CreateThread( function()
|
||||
end
|
||||
end )
|
||||
|
||||
|
||||
--[[----------------------------------------------------------------------------------
|
||||
Radar variables
|
||||
|
||||
|
||||
Reference in New Issue
Block a user