Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: !RELOADED¡ on Jun 21, 2019, 11:52 PM

Title: Stop playing a Sound
Post by: !RELOADED¡ on Jun 21, 2019, 11:52 PM
I'm making a music player for a system I'm doing, and I'd like to know if it's possible that the music stops when I press the STOP button and what function would it be?
Title: Re: Stop playing a Sound
Post by: umar4911 on Jun 22, 2019, 03:58 AM
i think player.Vehicle.Radio = 0
Title: Re: Stop playing a Sound
Post by: !RELOADED¡ on Jun 22, 2019, 04:11 PM
The function that I am using is that of PlaySoundForPlayer, and I have the doubt to know if the sound could be stopped
Title: Re: Stop playing a Sound
Post by: NicusorN5 on Jun 22, 2019, 05:24 PM
You can use something like that to stop the sound:
for(local i =0 ; i < 1000;i++) PlaySound( normal params but play an empty sound)
Because you will 'overflow' the sound memory and the sound card will play the empty sound instead afaik.
Title: Re: Stop playing a Sound
Post by: !RELOADED¡ on Jun 23, 2019, 06:22 AM
I tried your recommendation using PlaySound (player.World, 99999, player.Pos) as an example, but it does not work and it continues to play the sound, how does it work?
Title: Re: Stop playing a Sound
Post by: Luis_Labarca on Jun 23, 2019, 10:31 AM

hello friend that works does not exist only works to play once the audio started can not be stopped until I finish in a while I asked that question and you can not :-\
Title: Re: Stop playing a Sound
Post by: NicusorN5 on Jun 23, 2019, 02:06 PM
Quote from: Markhoz on Jun 23, 2019, 06:22 AMI tried your recommendation using PlaySound (player.World, 99999, player.Pos) as an example, but it does not work and it continues to play the sound, how does it work?
Use an existing sound.
Title: Re: Stop playing a Sound
Post by: !RELOADED¡ on Jun 23, 2019, 06:40 PM
It does not work with an existing sound either. but likewise thank you for answering
Title: Re: Stop playing a Sound
Post by: Luis_Labarca on Jun 24, 2019, 02:27 AM
Quote from: Markhoz on Jun 23, 2019, 06:40 PMIt does not work with an existing sound either. but likewise thank you for answering

friend does not work because that stop sound function does not exist for PlaySound ()

I also asked me how to stop a sound and they told me that I could not :-\ :-\