Great Scott! 1955!

This commit is contained in:
Dan
2020-02-28 22:38:10 +00:00
parent 9cdf7a753a
commit e8d6ab1689
3 changed files with 18 additions and 3 deletions

View File

@@ -988,10 +988,22 @@ function RADAR:SetAntennaSpeedLock( ant, speed, dir, lockType )
self:SetAntennaSpeedIsLocked( ant, true )
-- Send a message to the NUI side to play the beep sound with the current volume setting
SendNUIMessage( { _type = "audio", name = "beep", vol = RADAR:GetSettingValue( "beep" ) } )
SendNUIMessage( { _type = "audio", name = "beep", vol = self:GetSettingValue( "beep" ) } )
-- Send a message to the NUI side to play the lock audio with the current voice volume setting
SendNUIMessage( { _type = "lockAudio", ant = ant, dir = dir, vol = RADAR:GetSettingValue( "voice" ) } )
SendNUIMessage( { _type = "lockAudio", ant = ant, dir = dir, vol = self:GetSettingValue( "voice" ) } )
-- Great Scott!
if ( speed == "¦88" and self:GetSettingValue( "speedType" ) == "mph" ) then
math.randomseed( GetGameTimer() )
local chance = math.random()
-- 15% chance
if ( chance <= 0.15 ) then
SendNUIMessage( { _type = "audio", name = "speed_alert", vol = self:GetSettingValue( "beep" ) } )
end
end
end
end

View File

@@ -30,7 +30,10 @@ const audioNames =
away: "away.ogg",
// Plate reader
plate_hit: "plate_hit.ogg"
plate_hit: "plate_hit.ogg",
// Hmm
speed_alert: "speed_alert.ogg"
}
// Defines which audio needs to play for which direction

BIN
nui/sounds/speed_alert.ogg Normal file

Binary file not shown.