Duda Stream
#1

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?
Reply
#2

Con la funcion IsPlayerInRangeOfPoint.

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#3

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

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

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

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

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

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)