[Ajuda] Musicas
#1

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);
               }
        }
    } 
Reply
#2

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

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

Reply
#3

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
Reply
#4

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;

Reply
#5

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
Reply
#6

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); 
Reply
#7

IsPlayerInRangeOfPoint
Reply
#8

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
Reply
#9

Mostre a maneira que vocк fez.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)