[Ajuda]Quem esta perto
#1

Existe de algum modo de que eu esteja escutando uma musica do PlayAudioStreamForPlayer, e se alguem passar perto de mim ele tambйm escute a musica?

Ex: Estou com meu carro ouvindo uma musica pelo PlayAudioStreamForPlayer quando um pessoa passar por mim ela escutar o que eu estou ouvindo, e depois quando ela ficar longe parar o som.

existe um jeito de fazer isso ou algo parecido?
Reply
#2

Atй Existe, acho que assim:

pawn Code:
new Float:p1x, Float:p1y, Float:p1z;
GetPlayerPos(playerid, p1x, p1y, p1z);
if(IsPlayerInRangeOfPoint(playerid, 10.0, p1x, p1y, p1z)) return PlayAudioStreamForPlayer(playerid, "URL");
Com esse Code Acho que й Possivel '-'
Reply
#3

Sim, com umas variбveis e um temporizador para atualizar a posiзгo. Mais nгo daria certo, o samp sу executa uma mъsica por vez, logo se 2 players ligarem uma mъsica vai bugar tudo.
Reply
#4

https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer
Reply
#5

Acho que se usar um loop + playaudiostreamerforplayer deve funcionar, a nгo ser que, o samp tenha um limite ou algo assim.
Reply
#6

aiai so quis matar
Reply
#7

Ja que nгo funcionaria com um player pois ia dar bug, tem algum modo de ouvir ela sу em um certo local?
Reply
#8

Usando IsPlayerInRangeOfPoint:
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#9

Um exemplo?
Reply
#10

Jб tentaram PlayAudioStreamForPlayer usando os parвmetros opcionais?
Wiki:
Code:
Parameters:
(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
playerid	The player you want to stream the audio for.
url[]	The url to open. Valid formats are mp3 and ogg/vorbis.
Float:PosX	The X position at which to play the audio. Default 0.0. Has no effect unless usepos is set to 1.
Float:PosY	The Y position at which to play the audio. Default 0.0. Has no effect unless usepos is set to 1.
Float:PosZ	The Z position at which to play the audio. Default 0.0. Has no effect unless usepos is set to 1.
Float:distance	The distance over which the audio will be heard. Has no effect unless usepos is set to 1.
usepos	Use the positions and distance specified. Default disabled (0).

Returns	This function doesn't return a specific value

Example
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/play radio", cmdtext, true) == 0) 
    {
        PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls");
        return 1;
    }
    if (strcmp("/radio in my pos", cmdtext, true) == 0)
    {
        new Float:X, Float:Y, Float:Z, Float:Distance = 5.0;
        GetPlayerPos(playerid, X, Y, Z);
	PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 1);
	return 1;
    }
    return 0;
}
Reply
#11

Vlw fica atй mais alto quando chega mais perto. +rep pra quem pra todos que ajudarгo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)