Portal SAMP
[Ajuda] Verificar posiçao e setar som - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Verificar posiçao e setar som (/showthread.php?tid=1042)



Verificar posiçao e setar som - Smith - 06/04/2021

galera como qual função  para fazer uma verificação  de distancia entre um player e um objeto de som?
tipo se a pessoa estiver proximo ao local ou obejto começa a tocar uma musica no caso 
Código:
PlayAudioStreamForPlayer(i, "http://51.161.13.49:8174/stream");
e ao sair de perto do objeto ou local o PlayAudioStreamForPlayer Pare de tocar


RE: Verificar posiçao e setar som - SvCross. - 06/04/2021

IsPlayerInRangeOfPoint pode lhe ajudar.


RE: Verificar posiçao e setar som - Smith - 06/04/2021

(06/04/2021 22:29)SvCross. Escreveu: IsPlayerInRangeOfPoint pode lhe ajudar.

ja tentei nao funciona

Código:
for(new i = 0; i <MAX_PLAYERS; i++){
    if(IsPlayerInRangeOfPoint(playerid, 20.0, 1252.4000244141, -2041.8000488281, 61.299999237061))
    {
    PlayAudioStreamForPlayer(i, "http://51.161.13.49:8174/stream");
    return true;
    }
    }



RE: Verificar posiçao e setar som - xbruno1000x - 06/04/2021

PlayAudioStreamForPlayer(playerid, "LINK", X, Y, Z, Distance, 1);

Já existe função nativa pra fazer isso...
https://open.mp/pt/docs/scripting/functions/PlayAudioStreamForPlayer