Kraezd 1 Posted April 12, 2016 Share Posted April 12, 2016 (edited) Hey all. Love the great work contributed by so many. Just hoping for some guidance. I am making a script to play an audio file of mine before the audio file requested by any given callout script would play. I need help though. Is there any function that would help me do this? I'm thinking something on the lines of 'OnBeforeFunction'. My guess as to how it would appear: OnBeforeCalloutDisplayed() - check if callout is in my list of what would be an emergency dispatch transmission. OnBeforePlayScannerAudioUsingPosition - PlayScannerAudio("MY FILE THAT I PUT THE ALARM IN") My vision is that when we have a callout like an officer shot, the dispatcher makes an emergency transmission on the radio. It would be an alarm tone followed by the dispatcher advising all units to respond immediately. Initially, I thought to edit the relevant audio files, however the range and shared use of audio files makes this not possible. I am new to GTA V scripts, and to what LSPDFR has to offer in functionality, but I am appreciative of any help. Cheers! Edited April 12, 2016 by Kraezd Quote Link to comment Share on other sites More sharing options...
Fiskey111 788 Posted April 12, 2016 Share Posted April 12, 2016 Is this an issue solely with the Officer Shot callout, or is this for your own script? As for playing the audio - I don't see why you couldn't play the scanner during OnBeforeCalloutsDisplayed(). I haven't tried that before though! Quote Link to comment Share on other sites More sharing options...
Albo1125 4550 Posted April 12, 2016 Share Posted April 12, 2016 9 hours ago, Kraezd said: Hey all. Love the great work contributed by so many. Just hoping for some guidance. I am making a script to play an audio file of mine before the audio file requested by any given callout script would play. I need help though. Is there any function that would help me do this? I'm thinking something on the lines of 'OnBeforeFunction'. My guess as to how it would appear: OnBeforeCalloutDisplayed() - check if callout is in my list of what would be an emergency dispatch transmission. OnBeforePlayScannerAudioUsingPosition - PlayScannerAudio("MY FILE THAT I PUT THE ALARM IN") My vision is that when we have a callout like an officer shot, the dispatcher makes an emergency transmission on the radio. It would be an alarm tone followed by the dispatcher advising all units to respond immediately. Initially, I thought to edit the relevant audio files, however the range and shared use of audio files makes this not possible. I am new to GTA V scripts, and to what LSPDFR has to offer in functionality, but I am appreciative of any help. Cheers! I don't really see the problem? You can just add a Functions.PlayScannerAudio(youraudiofile) in the OnBeforeCalloutDisplayed override. Fiskey111 1 Quote My YouTube: Click here. My Discord Server - https://discord.gg/0taiZvBSiw5qGAXU Useful post? Let me and others know by clicking the Like button.Check out my many script modifications! Having issues? LSPDFR Troubleshooter by Albo1125. Link to comment Share on other sites More sharing options...
Kraezd 1 Posted April 12, 2016 Author Share Posted April 12, 2016 Thanks for the quick replies. I will give it a shot with BeforeCalloutDisplayed and post an update... I was just not sure if it would have a conflict playing audio (either overlapping with the callout audio or a delay) and it seemed more logical to call a function on the trigger of 'before the dispatch audio plays' as opposed to 'before you display the callout' but I will let you know! Thanks @fiskey111 & @Albo1125 Quote Link to comment Share on other sites More sharing options...
Fiskey111 788 Posted April 12, 2016 Share Posted April 12, 2016 The scanner only plays the first audio it gets to, unless it's finished by the time the next audio is set to play. For instance, if you had this: Functions.PlayScannerAudioUsingPosition("STUFF"); /// SOME CODE /// Functions.PlayScannerAudioUsingPosition("NEXT STUFF"); If the /// SOME CODE // doesn't take the length of time that "STUFF" would take (let's say 10 seconds) to play then the "NEXT STUFF" wouldn't play. However, if the first takes enough time (as in the /// SOME CODE /// takes 15 seconds to run, 5 seconds over the length of "STUFF") then the second will play. Albo1125 1 Quote Link to comment Share on other sites More sharing options...
PNWParksFan 2441 Posted April 12, 2016 Share Posted April 12, 2016 Is there a way to tell when the scanner audiois done playing, like how you can wait until a task is finished? If not, that should be added to the API. Darkmyre 1 Quote [REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos [REL] Police Tape: Make your scenes more realistic while stopping peds and traffic [REL] Better EMS: Realistic and dynamic EMS response Join the Parks Benefactor Program to support my work and get early beta access! Link to comment Share on other sites More sharing options...
Fiskey111 788 Posted April 12, 2016 Share Posted April 12, 2016 3 minutes ago, PNWParksFan said: Is there a way to tell when the scanner audiois done playing, like how you can wait until a task is finished? If not, that should be added to the API. Personally I just time the audio myself using all the pieces and make a new GameFiber that sleeps for that amount of time. It's a bit annoying to do, but if you need to do that then that's the only option I know of (until it's added to the API)! Quote Link to comment Share on other sites More sharing options...
PNWParksFan 2441 Posted April 12, 2016 Share Posted April 12, 2016 (edited) 3 minutes ago, fiskey111 said: Personally I just time the audio myself using all the pieces and make a new GameFiber that sleeps for that amount of time. It's a bit annoying to do, but if you need to do that then that's the only option I know of (until it's added to the API)! It would be nice if the play scanner function took a bool for whether to play it after the current audio is done. And if it had a wait until finished method. @LMS any chance this could be implemented in the next API update? Edited April 12, 2016 by PNWParksFan Fiskey111 and Darkmyre 2 Quote [REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos [REL] Police Tape: Make your scenes more realistic while stopping peds and traffic [REL] Better EMS: Realistic and dynamic EMS response Join the Parks Benefactor Program to support my work and get early beta access! Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.