SA-MP Forums Archive
[Ajuda] Musicas - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Musicas (/showthread.php?tid=568284)



Musicas - CaioTesio - 21.03.2015

Eae galera tava criando um sistema de dj aqui funcionou mas apenas eu ouзo a mъsica os players nгo ouvem nada!

Code:

PHP код:
if(dialogid == 772)
    {
        
TogglePlayerControllable(playerid1);
        if(!
response) { return 1; }
        switch(
listitem)
        {
            case 
0:
            {
                
PlayAudioStreamForPlayer(playerid"https://dl.dropboxusercontent.com/u/238210935/DJ/DaviDGuettaShotMeDown.mp3",1484.7277,-1748.0680,20.4053,180,1);
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
            }
               case 
1:
            {
                   
PlayAudioStreamForPlayer(playerid"https://dl.dropboxusercontent.com/u/238210935/DJ/TurnDownForWhat.mp3",1484.7277,-1748.0680,20.4053,180,1);
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
2:
            {
                
PlayAudioStreamForPlayer(playerid"https://dl.dropboxusercontent.com/u/238210935/DJ/Disclosure.mp3",1484.7277,-1748.0680,20.4053,180,1);
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
3:
            {
                
PlayAudioStreamForPlayer(playerid"https://dl.dropboxusercontent.com/u/238210935/DJ/NApontadope.mp3",1484.7277,-1748.0680,20.4053,180,1);
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
4:
            {
                
PlayAudioStreamForPlayer(playerid"https://dl.dropboxusercontent.com/u/238210935/DJ/WeDemBoyz.mp3",1484.7277,-1748.0680,20.4053,180,1);
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
5:
            {
                
PlayAudioStreamForPlayer(playerid"https://dl.dropboxusercontent.com/u/238210935/DJ/SkrillexRaggaBombwithRaggaTwins.mp3",1484.7277,-1748.0680,20.4053,180,1);
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
6:
            {
                
StopAudioStreamForPlayer(playerid);
                
format(stringsizeof(string), "O Player %s[%d]Parou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
        }
    } 



Re: Musicas - arakuta - 21.03.2015

Passa um loop por todos os jogadores, e inicia o audio pra eles.

PHP код:
for(new iMAX_PLAYERS; ++i)
{
    if(
IsPlayerConnected(i))
    {
        
// Inicia audio
    
}




Re: Musicas - CaioTesio - 21.03.2015

Quote:
Originally Posted by arakuta
Посмотреть сообщение
Passa um loop por todos os jogadores, e inicia o audio pra eles.

PHP код:
for(new iMAX_PLAYERS; ++i)
{
    if(
IsPlayerConnected(i))
    {
        
// Inicia audio
    
}

Com esse code, as musicas irao inicar automaticamente coisa q eu n queria kk


Re: Musicas - #Luca[S]. - 21.03.2015

Bom nгo testei, nгo sei se funciona mбs estб ai:
PHP код:
if(dialogid == 772)
    {
        
TogglePlayerControllable(playerid1);
        if(!
response) { return 1; }
        switch(
listitem)
        {
            case 
0:
            {
                
MusicaTodos("https://dl.dropboxusercontent.com/u/238210935/DJ/DaviDGuettaShotMeDown.mp3");
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
            }
               case 
1:
            {
                   
MusicaTodos("https://dl.dropboxusercontent.com/u/238210935/DJ/TurnDownForWhat.mp3");
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
2:
            {
                
MusicaTodos("https://dl.dropboxusercontent.com/u/238210935/DJ/Disclosure.mp3");
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
3:
            {
                
MusicaTodos("https://dl.dropboxusercontent.com/u/238210935/DJ/NApontadope.mp3");
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
4:
            {
                
MusicaTodos("https://dl.dropboxusercontent.com/u/238210935/DJ/WeDemBoyz.mp3");
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
5:
            {
                
MusicaTodos("https://dl.dropboxusercontent.com/u/238210935/DJ/SkrillexRaggaBombwithRaggaTwins.mp3");
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
6:
            {
                for(new 
i<MAX_PLAYERSi++)
            {
                
StopAudioStreamForPlayer(i);
                
format(stringsizeof(string), "O Player %s[%d]Parou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessagel(iCOR_CVstring);
               }
        }
    }
stock MusicaTodos(musica[])
{
    for(new 
i<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
        
PlayAudioStreamForPlayer(imusica);
        }
    }
    return 
1;




Re: Musicas - CaioTesio - 21.03.2015

Quote:
Originally Posted by TenhoUmaDuvida
Посмотреть сообщение
Bom nгo testei, nгo sei se funciona mбs estб ai:
PHP код:
if(dialogid == 772)
    {
        
TogglePlayerControllable(playerid1);
        if(!
response) { return 1; }
        switch(
listitem)
        {
            case 
0:
            {
                
MusicaTodos("https://dl.dropboxusercontent.com/u/238210935/DJ/DaviDGuettaShotMeDown.mp3");
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
            }
               case 
1:
            {
                   
MusicaTodos("https://dl.dropboxusercontent.com/u/238210935/DJ/TurnDownForWhat.mp3");
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
2:
            {
                
MusicaTodos("https://dl.dropboxusercontent.com/u/238210935/DJ/Disclosure.mp3");
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
3:
            {
                
MusicaTodos("https://dl.dropboxusercontent.com/u/238210935/DJ/NApontadope.mp3");
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
4:
            {
                
MusicaTodos("https://dl.dropboxusercontent.com/u/238210935/DJ/WeDemBoyz.mp3");
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
5:
            {
                
MusicaTodos("https://dl.dropboxusercontent.com/u/238210935/DJ/SkrillexRaggaBombwithRaggaTwins.mp3");
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
6:
            {
                for(new 
i<MAX_PLAYERSi++)
            {
                
StopAudioStreamForPlayer(i);
                
format(stringsizeof(string), "O Player %s[%d]Parou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessagel(iCOR_CVstring);
               }
        }
    }
stock MusicaTodos(musica[])
{
    for(new 
i<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
        
PlayAudioStreamForPlayer(imusica);
        }
    }
    return 
1;

Psй mas isso vai fazer com que todos os players ouзam a onde eles tiverem,mas oq eu quero й em um lugar apenas


Re: Musicas - #Luca[S]. - 21.03.2015

Mude o stock para
PHP код:
stock MusicaTodos(musica[], Float:xFloat:yFloat:zFloat:Distancia)
{
    for(new 
i<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
        
PlayAudioStreamForPlayer(imusicaxyzDistancia);
        }
    }
    return 
1;

E coloque de acordo com o desejado, exemplo:
PHP код:
MusicaTodos("LinkDaMusica"00540.5); 



Re: Musicas - Dayvison_ - 21.03.2015

IsPlayerInRangeOfPoint


Re: Musicas - CaioTesio - 21.03.2015

Quote:
Originally Posted by TenhoUmaDuvida
Посмотреть сообщение
Mude o stock para
PHP код:
stock MusicaTodos(musica[], Float:xFloat:yFloat:z)
{
    for(new 
i<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
        
PlayAudioStreamForPlayer(imusicaxyz);
        }
    }
    return 
1;

E coloque de acordo com o desejado, exemplo:
PHP код:
MusicaTodos("LinkDaMusica"005); 
Ainda apenas eu que ouзo... o resto nao


Re: Musicas - #Luca[S]. - 21.03.2015

Mostre a maneira que vocк fez.


Re: Musicas - CaioTesio - 21.03.2015

Quote:
Originally Posted by TenhoUmaDuvida
Посмотреть сообщение
Mostre a maneira que vocк fez.
PHP код:
case 0:
            {
                
MusicaTodos(playerid"https://dl.dropboxusercontent.com/u/238210935/DJ/DaviDGuettaShotMeDown.mp3",1484.7277,-1748.0680,20.4053,180,1);
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
            }
               case 
1:
            {
                   
MusicaTodos(playerid"https://dl.dropboxusercontent.com/u/238210935/DJ/TurnDownForWhat.mp3",1484.7277,-1748.0680,20.4053,180,1);
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
2:
            {
                
MusicaTodos(playerid"https://dl.dropboxusercontent.com/u/238210935/DJ/Disclosure.mp3",1484.7277,-1748.0680,20.4053,180,1);
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
3:
            {
                
MusicaTodos(playerid"https://dl.dropboxusercontent.com/u/238210935/DJ/NApontadope.mp3",1484.7277,-1748.0680,20.4053,180,1);
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
4:
            {
                
MusicaTodos(playerid"https://dl.dropboxusercontent.com/u/238210935/DJ/WeDemBoyz.mp3",1484.7277,-1748.0680,20.4053,180,1);
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               }
               case 
5:
            {
                
MusicaTodos(playerid"https://dl.dropboxusercontent.com/u/238210935/DJ/SkrillexRaggaBombwithRaggaTwins.mp3",1484.7277,-1748.0680,20.4053,180,1);
                
format(stringsizeof(string), "O Player %s[%d]Iniciou como DJ na prefeitura de Los Santos!!"PlayerName(playerid), playerid);
                   
SendClientMessageToAll(COR_CVstring);
               } 
Quando eu coloco MusicaTodos da o seguinte error no pawno

PHP код:
 error 035argument type mismatch (argument 1