SA-MP Forums Archive
Stopping a playing sound - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Stopping a playing sound (/showthread.php?tid=254379)



Stopping a playing sound - sim_sima - 10.05.2011

Hey guys.
When i use 'PlayerPlaySound' and plays a music sound, the sound loops and keeps playing.
How do i stop it again?

Hope you can help me. Thank you.


Re: Stopping a playing sound - JaTochNietDan - 10.05.2011

Use the Sound ID for stopping that sound, usually it's the sound ID you're playing incremented by 1 for the ID of the sound to stop it.

https://sampwiki.blast.hk/wiki/SoundID

See there for the complete list.


Re: Stopping a playing sound - sim_sima - 10.05.2011

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
Use the Sound ID for stopping that sound, usually it's the sound ID you're playing incremented by 1 for the ID of the sound to stop it.

https://sampwiki.blast.hk/wiki/SoundID

See there for the complete list.
So if i did "PlayerPlaySound(playerid, 1097, 0, 0, 0);"
i just have to do "PlayerPlaySound(playerid, 1097, 0, 0, 0);" again to stop it?


Re: Stopping a playing sound - JaTochNietDan - 10.05.2011

No you would have to use Sound ID 1098 according to the SA-MP Wiki:

Quote:

SOUND_AWARD_TRACK_START 1097 (music)
SOUND_AWARD_TRACK_STOP 1098 (music)

Which is like I said, it's usually the starting sound ID incremented by 1 to get the stopping sound ID.


Re: Stopping a playing sound - sim_sima - 10.05.2011

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
No you would have to use Sound ID 1098 according to the SA-MP Wiki:



Which is like I said, it's usually the starting sound ID incremented by 1 to get the stopping sound ID.
Oh, i got it wrong first time. Thank you.