diff --git a/cl_radar.lua b/cl_radar.lua index b94e4d2..cdf7b93 100644 --- a/cl_radar.lua +++ b/cl_radar.lua @@ -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 diff --git a/nui/radar.js b/nui/radar.js index 8f96e3f..5042c7c 100644 --- a/nui/radar.js +++ b/nui/radar.js @@ -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 diff --git a/nui/sounds/speed_alert.ogg b/nui/sounds/speed_alert.ogg new file mode 100644 index 0000000..cb417d4 Binary files /dev/null and b/nui/sounds/speed_alert.ogg differ