SA-MP Forums Archive
Duda Stream - 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: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Duda Stream (/showthread.php?tid=537953)



Duda Stream - Alban - 19.09.2014

Hola como puedo hacer que todos los jugadores que estйn cerca del lugar puedan escuchar este audio:
pawn Код:
new Float:X, Float:Y, Float:Z, Float:Distance = 6.0;
            GetPlayerPos(playerid, X, Y, Z);
            Forze = random(4);
                switch(Forze)
               {
                case 0,1:
                {
                    PlayAudioStreamForPlayer(playerid, "PAGNINA", X, Y, Z, Distance, 1);
Porque dice Playerid y tengo la duda si lo escucho solamente yo o si lo escuchan los demбs tambiйn. Solo quiero que lo escuchen todos los que estбn cerca de ese lugar, alguien me podrнa ayudar con esto?


Respuesta: Duda Stream - TheScriptMan - 19.09.2014

Con la funcion IsPlayerInRangeOfPoint.

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Re: Duda Stream - Alban - 21.09.2014

Si la conosco pero igual solo lo escucha el jugador que ejecuta esa funciуn, no los demбs que estбn a su alrededor


Re: Duda Stream - SickAttack - 21.09.2014

Tienes que hacer un loop. Te recomiendo 'foreach' para hacer esto.


Re: Duda Stream - Alban - 21.09.2014

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Tienes que hacer un loop. Te recomiendo 'foreach' para hacer esto.
їMe explicarlas un poco?


Respuesta: Duda Stream - Alexander11 - 21.09.2014

Proba asн:
pawn Код:
new Float:X, Float:Y, Float:Z, Float:Distance = 6.0;
GetPlayerPos(playerid, X, Y, Z);
foreach(new i : Player)
{
    if(IsPlayerInRangeOfPoint(i, Distance, X, Y, Z);
    {
        PlayAudioStreamForPlayer(i, "PAGNINA", X, Y, Z, Distance, 1);
    }
}



Respuesta: Duda Stream - Swedky - 21.09.2014

pawn Код:
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
foreach(new i: Player)
{
    PlayAudioStreamForPlayer(i, url[], Pos[0], Pos[1], Pos[2], dist, 1);
}



Respuesta: Duda Stream - Alexander11 - 21.09.2014

Quote:
Originally Posted by EnzoMetlc
Посмотреть сообщение
pawn Код:
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
foreach(new i: Player)
{
    PlayAudioStreamForPlayer(i, url[], Pos[0], Pos[1], Pos[2], dist, 1);
}
El tuyo esta bien xD

PD: Te amo Enzo.


Re: Duda Stream - SickAttack - 22.09.2014

Aqui esta, editalo a tu gusto.

pawn Код:
new Float:x = 0.0, Float:y = 0.0, Float:z = 0.0, Float:dist = 10.0;
foreach(new i: Player) if(IsPlayerInRangeOfPoint(i, dist, x, y, z)) PlayAudioStreamForPlayer(i, url[], x, y, z, dist, 1);



Respuesta: Re: Duda Stream - Swedky - 22.09.2014

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Aqui esta, editalo a tu gusto.

pawn Код:
new Float:x = 0.0, Float:y = 0.0, Float:z = 0.0, Float:dist = 10.0;
foreach(new i: Player) if(IsPlayerInRangeOfPoint(i, dist, x, y, z)) PlayAudioStreamForPlayer(i, url[], x, y, z, dist, 1);
Es lo mismo pero mi mйtodo es mejor