[Ajuda] musica no carro
#7

Quote:
Originally Posted by Murilo_sousa
Посмотреть сообщение
pawn Код:
// No Topo do GM
new bool:AtivouMusica[MAX_PLAYERS];
new TimerAtuMusica[MAX_PLAYERS];

public OnPlayerDisconnect(playerid)
{
    // Resetamos a variavel para quando o jogador deslogar e logar outro com o mesmo ID nгo bulgar
    AtivouMusica[playerid] = false;
    KillTimer(TimerAtuMusica[playerid]);
    return 1;
}


// No cmd que ativa a musica

CMD:musicas(playerid)
{
    // Code aqui
    AtivouMusica[playerid] = true;
    TimerAtuMusica[playerid] = SetTimerEx("AtualizarMusica", 10000, true, "d", playerid);
    return 1;
}

// para atualizar

forward AtualizarMusica(playerid);
public AtualizarMusica(playerid)
{
    if(AtivouMusica[playerid] == true)
    {
        if(IsPlayerConnected(playerid))
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                static Float:X, Float:Y, Float:Z, Float:Distance = 5.0;
                GetPlayerPos(i, X,Y,Z);
                PlayAudioStreamForPlayer(i, "https://dl.dropbox.com/s/ewoyr0ydsfcff4z/Lfao2.mp3", X, Y, Z, Distance, 1);
            }
        }
    }
    return 1;
}

// Mude o tempo desejad para atualizar a posiзгo do jogador, no caso estб em 10 segundos,
Desse modo a funзгo "PlayAudioStreamForPlayer", nгo irб ser chamada varias vezes e irб bugar ?
Reply


Messages In This Thread
musica no carro - by wallacematheus - 26.02.2013, 11:21
Re: musica no carro - by Schocc - 26.02.2013, 13:33
AW: musica no carro - by wallacematheus - 26.02.2013, 17:40
Re: musica no carro - by Supera - 26.02.2013, 17:51
AW: musica no carro - by wallacematheus - 26.02.2013, 18:08
Re: musica no carro - by Maklister - 26.02.2013, 18:18
Re: musica no carro - by Supera - 26.02.2013, 18:32
Re: musica no carro - by Maklister - 26.02.2013, 18:35
AW: musica no carro - by wallacematheus - 26.02.2013, 20:03
Re: musica no carro - by Supera - 26.02.2013, 20:15

Forum Jump:


Users browsing this thread: 7 Guest(s)