Stopping a playing sound
#1

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.
Reply
#2

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.
Reply
#3

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?
Reply
#4

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.
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)