Jump to content

Playing Scanner Audio with LSPDFR API


AlconH

Recommended Posts

I'm currently working on a plugin using the LSPDFR API but am having trouble with the scanner audio.

Functions.PlayScannerAudio("NEED_BACKUP_NOW")
GameFiber.Sleep(3000)
Functions.PlayScannerAudioUsingPosition("ATTENTION_ALL_UNITS ASSISTANCE_REQUIRED IN_OR_ON_POSITION CODE_3", Game.LocalPlayer.Character.Position);

The problem is, the first audio: "NEED_BACKUP_NOW", plays perfectly, but the second piece of audio doesn't play. The rest of the script executes perfectly, and it appears that the second audio statement is skipped.

Does anyone have any experience with this?

Link to comment
Share on other sites

Probably the problem is that LSPDFR can only play one audio at once. When the second audio should start, the first audio might still playing. You can either make the sleep time bigger or simulate the sounds between one audio and other in only one PlayScannerAudio() like I did:

Functions.PlayScannerAudioUsingPosition(
"CRIME_OFFICER_REQUESTS_AIR_SUPPORT IN_OR_ON_POSITION OUTRO/*Here you play the outro audio and then the intro audio*/ OFFICER_INTRO HELI_APPROACHING_DISPATCH", Game.LocalPlayer.Character.Position);
Edited by alexguirre
Link to comment
Share on other sites

Probably the problem is that LSPDFR can only play one audio at a time. When the second audio should start, the first audio might still playing. You can either make te sleep time bigger or simulate the sounds between one audio and other in only one PlayScannerAudio() like I did:

Functions.PlayScannerAudioUsingPosition("CRIME_OFFICER_REQUESTS_AIR_SUPPORT IN_OR_ON_POSITION OUTRO/*Here you play the outro audio and then the intro audio*/ OFFICER_INTRO HELI_APPROACHING_DISPATCH", Game.LocalPlayer.Character.Position);

Hmmmm... That's a surprise because the first audio is less than 3 seconds long, but I'll give it a try and get back to you.

Thanks for your help.

Link to comment
Share on other sites

Hmmmm... That's a surprise because the first audio is less than 3 seconds long, but I'll give it a try and get back to you.

Thanks for your help.

Remember that LSPDFR adds more audios, like the INTRO, the OUTRO or the NOISE_LOOP, so it makes it longer.

Edited by alexguirre
Link to comment
Share on other sites

Remember that LSPDFR adds more audios, like the INTRO, the OUTRO or the NOISE_LOOP, so it makes it longer.

That's probably what it was. Increasing the sleep time solved the problem.

Another quick question, do you know how to add the Key icons to the dialogues? Such as:

Game.DisplayHelp("Press F10 to continue.", true);

But instead of displaying just the text F10, it instead displays the actual graphic for that button? 

Edited by AlconH
Link to comment
Share on other sites

That's probably what it was. Increasing the sleep time solved the problem.

Another quick question, do you know how to add the Key icons to the dialogues? Such as:

Game.DisplayHelp("Press F10 to continue.", true);

But instead of displaying just the text F10, it instead displays the actual graphic for that button? 

Look at this topic in gtaforums: http://gtaforums.com/topic/808173-list-of-input-names/?hl=input

As you can see it uses the game controls and the problem with that is that if the user changes the game keys, the key icon also will change. And I don't know if there is any control that uses  the F10 key by default. That's the only method I know of.

Link to comment
Share on other sites

Look at this topic in gtaforums: http://gtaforums.com/topic/808173-list-of-input-names/?hl=input

As you can see it uses the game controls and the problem with that is that if the user changes the game keys, the key icon also will change. And I don't know if there is any control that uses  the F10 key by default. That's the only method I know of.

Ah damn. That's a shame. Thanks anyway.

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...