[AYUDA] PlayAudioStreamForPlayer Radio y DIALOG_STYLE_INPUT
#1

lo que yo quiero es hacer que todos oigan un stream en un punto a un radio distancia de 150 pero el problema es que yo lo quiero es por distintas link de musica es decir que yo lo inserte el link por DIALOG_STYLE_INPUT y tambien que la pos X Y y Z sea la del que hizo el cmd, pero yo ala hora de compilar me da un error y es que ahi se cruzan las dos variables la de para todos el LINK que se va a poner y la del XYZ del que realiza el comando, xD no se si me entiendan a lo que me refiero!,

pawn Код:
new Float:X, Float:Y, Float:Z, Float:Distance = 150.0;
        GetPlayerPos(playerid, X, Y, Z);
    PlayAudioStreamForPlayer(playerid, LINK, X, Y, Z, Distance, 1);


(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
ACA ES DONDE TENGO EL ERROR DESPUES DEL RESPONSE CUANDO PONE UNO EL LINK EN EL DIALOG SYLE INPUTO YO LE TENGO LA RESPUESTA ASI

pawn Код:
if(dialogid == Musica2)
    {
        if(response)
        {
            ReproducirCancion(inputtext,X,Y,Z,Distancia); // compilando me dice error en esta linea: Error X
        }
        return 1;
    }
//y la resultante es
stock ReproducirCancion(link[],X,Y,Z,Distancia){

        for(new i, l = GetMaxPlayers();i<l;i++) if(IsPlayerConnected(i))
        //StopAudioStreamForPlayer(i);
        PlayAudioStreamForPlayer(i, link,X,Y,Z,Distancia,1); // compilando me dice errorr en esta linea: Error Distancia
}
ahi alguna otra forma de hacerlo? o que no me entienden? jajajano soy muy expresivo
gracias por su atencion onrojado:
Reply
#2

podrias dejar el error que te marca?
Reply
#3

pawn Код:
if(dialogid == Musica2)
    {
        if(response)
        {
            ReproducirCancion(inputtext,X,Y,Z,Distancia); // compilando me dice error en esta linea: Error X
        }
        return 1;
    }
//y la resultante es
stock ReproducirCancion(link[],X,Y,Z,Distancia){

        for(new i, l = GetMaxPlayers();i<l;i++) if(IsPlayerConnected(i))
        //StopAudioStreamForPlayer(i);
        PlayAudioStreamForPlayer(i, link,X,Y,Z,Distancia,1); // compilando me dice errorr en esta linea: Error Distancia
}
eso si faltaba no me acordaba :S
Reply
#4

intenta con esto:

Код:
stock ReproducirCancion(link[],X,Y,Z,Distancia){
        for(new i, i = GetMaxPlayers();i<i;i++) if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, Distancia, X,Y,Z))
        {
        StopAudioStreamForPlayer(i);
        PlayAudioStreamForPlayer(i, link);
        }
}
Reply
#5

errorres
pawn Код:
D:\Tod...............v2.2.1.1.pwn(22511) : error 017: undefined symbol "X"
D:\Tod...............v2.2.1.1.pwn(29743) : warning 204: symbol is assigned a value that is never used: "Distancia"
D:\Tod...............v2.2.1.1.pwn(56642) : error 021: symbol already defined: "i"
D:\Tod...............v2.2.1.1.pwn(56642) : warning 203: symbol is never used: "i"
y en el code va
pawn Код:
if(dialogid == Musica2)
    {
        if(response)
        {
(22511) ReproducirCancion(inputtext,X,Y,Z,Distancia);
        }
        return 1;
    }
===============
    CMD:iniciarconcierto(playerid, params[])
    {

(29743)new Float:X, Float:Y, Float:Z, Float:Distancia = 100.0;
           GetPlayerPos(playerid, X, Y, Z);
        ShowPlayerDialog(playerid,NMusica2,DIALOG_STYLE_INPUT,"Donde Iniciara?","Donde Iniciara y quien cantara?","Siguiente","Cancelar");
        return 1;
    }
//////////////////
stock ReproducirCancion(link[],X,Y,Z,Distancia){
(56642) for(new i, i = GetMaxPlayers();i<i;i++) if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, Distancia, X,Y,Z))
        //StopAudioStreamForPlayer(i);
        PlayAudioStreamForPlayer(i, link,X,Y,Z,Distancia,1);
}
:S que rayos pasa xD
Reply
#6

En ves de ese stock utiliza
PlayAudioStreamForAll que es mбs fбcil.
Reply
#7

vaya que soy ignorante en esto, me ayudas? osea seria algo asi encontre esto pero sigue siendo stock xD

Код:
stock PlayAudioStreamForAll(url[])
{
    for(new i = 0, e = GetMaxPlayers(); i < e; i++)
    {
        if(IsPlayerConnected(i))
        {
            PlayAudioStreamForPlayer(i, url);
        }
    }
    return 1;
}
osea que me quedaria asi?

Код:
stock PlayAudioStreamForAll(url[],X,Y,Z,Distancia)
{
    for(new i = 0, e = GetMaxPlayers(); i < e; i++)
    {
        if(IsPlayerConnected(i))
        {
            PlayAudioStreamForPlayer(i,url,X,Y,Z,Distancia,1);
        }
    }
    return 1;
}
Pero me sigue saliendo error en

Код:
stock PlayAudioStreamForAll(url[],X,Y,Z,Distancia)
{
    for(new i = 0, e = GetMaxPlayers(); i < e; i++)
    {
        if(IsPlayerConnected(i))
        {
            PlayAudioStreamForPlayer(i,url,X,Y,Z,Distancia,1); // error en esta linea por "Distancia"
        }
    }
    return 1;
}
if(dialogid == Musica2)
	{
		if(response)
		{
  			PlayAudioStreamForAll(inputtext,X,Y,Z,Distancia); // error en esta linea por "X"
		}
		return 1;
	}
ayuda!!
Reply
#8

La funciуn PlayAudioStreamForAll es nativa del SA-MP
Reply
#9

PlayAudioStreamForAll si ahi actualice lo que me sale que sera el error parce?

QUOTE:
vaya que soy ignorante en esto, me ayudas? osea seria algo asi encontre esto pero sigue siendo stock xD

Код:
stock PlayAudioStreamForAll(url[])
{
    for(new i = 0, e = GetMaxPlayers(); i < e; i++)
    {
        if(IsPlayerConnected(i))
        {
            PlayAudioStreamForPlayer(i, url);
        }
    }
    return 1;
}
osea que me quedaria asi?

Код:
stock PlayAudioStreamForAll(url[],X,Y,Z,Distancia)
{
    for(new i = 0, e = GetMaxPlayers(); i < e; i++)
    {
        if(IsPlayerConnected(i))
        {
            PlayAudioStreamForPlayer(i,url,X,Y,Z,Distancia,1);
        }
    }
    return 1;
}
Pero me sigue saliendo error en

Код:
stock PlayAudioStreamForAll(url[],X,Y,Z,Distancia)
{
    for(new i = 0, e = GetMaxPlayers(); i < e; i++)
    {
        if(IsPlayerConnected(i))
        {
            PlayAudioStreamForPlayer(i,url,X,Y,Z,Distancia,1); // error en esta linea por "Distancia"
        }
    }
    return 1;
}
if(dialogid == Musica2)
	{
		if(response)
		{
  			PlayAudioStreamForAll(inputtext,X,Y,Z,Distancia); // error en esta linea por "X"
		}
		return 1;
	}
ayuda!!
Reply
#10

Perdуn me equivoquй la funciуn no es nativa de SA-MP me confundн.
Usб este stock
pawn Код:
stock PlayAudioStreamForAll(url[], Float:X,Float:Y,Float:Z,Float:distance, usepos)
{
for(new player = 0; player < MAX_PLAYERS; player++)
{
PlayAudioStreamForPlayer(player, url, X,Y,Z,distance,usepos);
}
return 1;
}
El stock lo diseсй reciйn. Capaz tiene algъn error. (lo dudo)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)