mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Added new plate hit BOLO sound
This commit is contained in:
@@ -104,7 +104,7 @@ function READER:GetCamLocked( cam )
|
||||
end
|
||||
|
||||
-- Locks the given reader
|
||||
function READER:LockCam( cam )
|
||||
function READER:LockCam( cam, playAudio )
|
||||
-- Check that plate readers can actually be locked
|
||||
if ( PLY:VehicleStateValid() and self:CanPerformMainTask() ) then
|
||||
-- Toggle the lock state
|
||||
@@ -115,8 +115,12 @@ function READER:LockCam( cam )
|
||||
|
||||
-- Play a beep
|
||||
if ( self:GetCamLocked( cam ) ) then
|
||||
if ( playAudio ) then
|
||||
SendNUIMessage( { _type = "audio", name = "beep", vol = RADAR:GetSettingValue( "plateAudio" ) } )
|
||||
end
|
||||
|
||||
TriggerEvent( "wk:onPlateLocked", cam, self:GetPlate( cam ), self:GetIndex( cam ) )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -186,11 +190,16 @@ function READER:Main()
|
||||
|
||||
-- Automatically lock the plate if the scanned plate matches the BOLO
|
||||
if ( plate == self:GetBoloPlate() ) then
|
||||
self:LockCam( cam )
|
||||
self:LockCam( cam, false )
|
||||
|
||||
SendNUIMessage( { _type = "audio", name = "plate_hit", vol = RADAR:GetSettingValue( "plateAudio" ) } )
|
||||
end
|
||||
|
||||
-- Send the plate information to the NUI side to update the UI
|
||||
SendNUIMessage( { _type = "changePlate", cam = cam, plate = plate, index = index } )
|
||||
|
||||
-- Trigger the event so developers can hook into the scanner
|
||||
TriggerEvent( "wk:onPlateScanned", cam, plate, index )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1626,12 +1626,12 @@ function RunControlManager()
|
||||
|
||||
-- Locks front plate reader
|
||||
if ( IsDisabledControlJustPressed( 1, CONFIG.plate_front_lock_key ) ) then
|
||||
READER:LockCam( "front" )
|
||||
READER:LockCam( "front", true )
|
||||
end
|
||||
|
||||
-- Locks front plate reader
|
||||
if ( IsDisabledControlJustPressed( 1, CONFIG.plate_rear_lock_key ) ) then
|
||||
READER:LockCam( "rear" )
|
||||
READER:LockCam( "rear", true )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -27,7 +27,10 @@ const audioNames =
|
||||
front: "front.ogg",
|
||||
rear: "rear.ogg",
|
||||
closing: "closing.ogg",
|
||||
away: "away.ogg"
|
||||
away: "away.ogg",
|
||||
|
||||
// Plate reader
|
||||
plate_hit: "plate_hit.ogg"
|
||||
}
|
||||
|
||||
// Defines which audio needs to play for which direction
|
||||
|
||||
BIN
nui/sounds/plate_hit.ogg
Normal file
BIN
nui/sounds/plate_hit.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user