Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Solved] Randomize Scanner Audio?

Featured Replies

So, I was wondering if it would be possible to randomize the Scanner Audio for a callout? You know like different combinations of the audio files rather than one for every time? Here is what I was thinking:

 

Mostly I want to do this for the Response Code part of the Scanner Audio since I noticed there are these files for Response Codes:

 

  • UNITS_RESPOND_CODE_02_01.wav
  • UNITS_RESPOND_CODE_02_02.wav
  • UNITS_RESPOND_CODE_03_01.wav
  • UNITS_RESPOND_CODE_03_02.wav
  • UNITS_RESPOND_CODE_99_01.wav
  • UNITS_RESPOND_CODE_99_02.wav
  • UNITS_RESPOND_CODE_99_03.wav

 

I was thinking I might be able to randomize the audio files played by doing this:

 

private readonly String[] ResponseCodes = new String[] { "UNITS_RESPOND_CODE_03_01", "UNITS_RESPOND_CODE_03_02" }; // A list of possible "said" response codes.
private String ChosenResponseCode; // Assigned later.
private readonly Random rnd = new Random(); // A new random (used later).

ChosenResponseCode = ResponseCodes[rnd.Next(ResponseCodes.Length)]; // Chooses random string from "ResponseCodes" String Array.
Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_GRAND_THEFT_AUTO IN_OR_ON_POSITION" + ChosenResponseCode, SVLCGSDSpawnPoint); // Plays the scanner audio.

Would this be a good way of handling this? Or is there a simpler way of doing this? Can LSPDFR Figure out which file it is or choose a random files if I only put in "UNITS_RESPOND_CODE_03" or do I need to specify?

 

Thanks in advanced,

- Johnny Shumway

Edited by OfficerJohnnyShumway
Question has been solved.

10 hours ago, OfficerJohnnyShumway said:

So, I was wondering if it would be possible to randomize the Scanner Audio for a callout? You know like different combinations of the audio files rather than one for every time?

 

 

As far as i know LSPDFR is randomizing the files itself.

 

By using this for the string "UNITS_RESPOND_CODE_02", lspdfr will choose "_01" or "_02" to randomize these files. (as soon  as you have "UNITS_RESPOND_CODE_02_02.wav"

)
No need to write your own speech randomizer.

Edited by ziipzaaapM16A4

Take a look at my Plugins:

AmbientAICallouts: Ai get calls too. Callouts can turn into a backup request for the player [YouTube Link]

Search Vehicle Plugin: Simple and more Immersive Vehicle Search Plugin [YouTube Link]

What Was You Name Again?: Get the name of a Suspect even when arrested and placed in your Vehicle [YouTube Link]
Corpse Inspection:  Investigate the corpse. Interact and search for details in a more Cinematic way  [YouTube Link]
[WIP] EnvoirementalCallouts: A couple of Callouts and WorldEvents that are likely to happen to you while you're on duty [Youtube Link]

[OnHold] EMS Support: Be the First Responder of Medical Emergency's and do CPR on Patients [YouTube Link]

 

spacer.png

Checkout my Patreon for Early Access to my mods                                       checkout my Discord Server

  • Author
13 hours ago, ziipzaaapM16A4 said:

 

 

As far as i know LSPDFR is randomizing the files itself.

 

By using this for the string "UNITS_RESPOND_CODE_02", lspdfr will choose "_01" or "_02" to randomize these files. (as soon  as you have "UNITS_RESPOND_CODE_02_02.wav"

)
No need to write your own speech randomizer.

Thank you so much!

  • The title was changed to [Solved] Randomize Scanner Audio?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.