a little help
#1

Hello all once again i need some help.

I wanna know that how can I play sound at time.

I mean for eg:- when a timer ends play this sound playaudiostreamforplayer(playerid,"******.com")

i want to play this stream for all players when timer finish.
Reply
#2

//inside cmd or callback
//note that callback should have the parameter "playerid" as we are going to pass to the timer
SetTimerEx("PlaySound",TIMEINMILISECS,false,"i",pl ayerid);

//NOT inside any cmd or callback
forward PlaySound(playerid);
public PlaySound(playerid)
{
PlayAudioStreamForPlayer(playerid,"******.com");
}
Reply
#3

Quote:
Originally Posted by xTURBOx
Посмотреть сообщение
//inside cmd or callback
//note that callback should have the parameter "playerid" as we are going to pass to the timer
SetTimerEx("PlaySound",TIMEINMILISECS,false,"i",pl ayerid);

//NOT inside any cmd or callback
forward PlaySound(playerid);
public PlaySound(playerid)
{
PlayAudioStreamForPlayer(playerid,"******.com");
}
I have already done this but I dont know why the sound is not playing.

edit: Fixed ty very much turbo.
Reply
#4

Код:
SetTimerEx("PlaySound",TIMEINMILISECS,false,"i",playerid);

//NOT inside any cmd or callback
forward PlaySound(playerid);
public PlaySound(playerid)
{
    for(new i = 0; j = GetPlayerPoolSize(); i <= j; i++) { // For player sound for all players
        PlayAudioStreamForPlayer(i,"******.com");
    }
}
Instead of "******.com" you need to insert a valid mp3, or another sound format, link
Reply
#5

Quote:
Originally Posted by J4Rr3x
Посмотреть сообщение
Код:
SetTimerEx("PlaySound",TIMEINMILISECS,false,"i",playerid);

//NOT inside any cmd or callback
forward PlaySound(playerid);
public PlaySound(playerid)
{
    for(new i = 0; j = GetPlayerPoolSize(); i <= j; i++) { // For player sound for all players
        PlayAudioStreamForPlayer(i,"******.com");
    }
}
Instead of "******.com" you need to insert a valid mp3, or another sound format, link
that was an example man not real one
Reply
#6

@J4Rr3x and @sreyas i know ******.com is example i mean that the mesaage of audio played didnt appeared but i fixed it now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)