Music stops after few seconds
#1

Hey, I'm wondering if I can make the PlayAudioStreamForPlayer play for a certain amount of time.
When I connect to the server the music will start playing (I already done this) then it will stop after around 30 seconds. Right now it stops OnPlayerSpawn since I don't know how to make this within time.

Any ideas?
Reply
#2

Any other sounds on OnPlayerSpawn?
Reply
#3

In the beginning of the script:
Код:
forward StopPlayingMusic(playerid);
At OnPlayerConnect (where you start playing the music):
Код:
SetTimerEx("StopPlayingMusic", 30000, false, "i", playerid);
Somewhere in your script, NOT inside a callback!
Код:
public StopPlayingMusic(playerid)
{
    StopAudioStreamForPlayer(playerid);
}
Reply
#4

I will test Conradus' suggestion. If it works, I'll give you a rep up.
Ty!
Reply
#5

Conradus: The music stopped when I spawn.
I want it to keep playing from when I spawn as well. 30 seconds from I connect, then I can play for a few seconds and it should stop.
Reply
#6

I think you have "StopAudioStreamForPlayer(playerid);" somewhere in your "OnPlayerSpawn" callback. If you do, remove it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)