30.05.2016, 06:30
You can do it by this way:
PHP код:
SetTimerEx("Aduioz", 17000, 0, "di", playerid, 0); // set the timer for player with audio id 0
PHP код:
forward public Aduioz(playerid, audioz);
public Aduioz(playerid, audioz) {
switch(audioz) { // switch audio idz
case 0: { // check if id is 0
PlayAudioStreamForPlayer(playerid, "http://vignette4.wikia.nocookie.net/containmentbreach/images/2/22/Alarm2.ogg/revision/latest?cb=20130914185645"); // player song 1
SetTimerEx("Aduioz", 17000, 0, "di", playerid, 1); // set timer to play song 2
}
case 1: { // check if song id is 1
PlayAudioStreamForPlayer(playerid, "https://hydra-media.cursecdn.com/scpcb.gamepedia.com/f/f3/HCZ_Background.ogg"); // player song 2
SetTimerEx("Aduioz", 17000, 0, "di", playerid, 175566); // set timer to stop song
}
case 175566,default: // check if id match with stop audio id
StopAudioStreamForPlayer(playerid); // stop song for player
}
}
}