SA-MP Forums Archive
Music on player position - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Music on player position (/showthread.php?tid=393891)



Music on player position - DarkOrion11 - 20.11.2012

I want to play music on player position. If other players near to player hear music. Like /music [URL]. Any one can help me about this?


Re: Music on player position - jueix - 20.11.2012

Simple, but it can only be like. If a player is lets saying listening to Eminem Loose yourself and an other play goes near, It won't play from the player's point of the song that is listening it will reset it to the beginning. Is this what you want?


Re: Music on player position - Windrush - 20.11.2012

pawn Код:
CMD:music(playerid,params[])
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    new musicurl[128];
    if(sscanf(params, "s", musicurl)) return SendClientMessage(playerid, 0xFF0000FF, "/music <url>");
    PlayAudioStreamForPlayer(playerid, musicurl , X, Y, Z, 30.0, 1);
    return 1;
}
Try It
Usage: /music <url>
Example /music "www.mysite.com/testing.mp3"

Remember Always Add This " "


Re: Music on player position - Camorra - 20.11.2012

@jueix - i think you worng mate.
Ill explain why im say it.
Well he can set few songs under IsPlayerInRangeOfPoint, or create new stock and make the position far like x+4,y+4,z+4.
And create few positions.
So if player is around it the music will turn on, if you going out from the area around the pos its auto turn off.
Just idea and mabye i worng.

Sorry for my bad english, imma high

Here you can see about the IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Re: Music on player position - Konstantinos - 20.11.2012

It's possible if and only if you use a timer. Inside that callback, it will search if players are in range of point, in your case your coordinates and it will play the song!


Re: Music on player position - DarkOrion11 - 20.11.2012

@jueix
Yes.

@windrush
Код:
C:\Users\DarkOrion11\Documents\Test\test.pwn(7431) : error 017: undefined symbol "music"
C:\Users\DarkOrion11\Documents\Test\test.pwn(7436) : error 017: undefined symbol "params"
C:\Users\DarkOrion11\Documents\Test\test.pwn(7431) : warning 203: symbol is never used: "CMD"



AW: Music on player position - Skimmer - 20.11.2012

You need ZCMD.inc. Here is the link: https://sampforum.blast.hk/showthread.php?tid=91354


Re: AW: Music on player position - DarkOrion11 - 20.11.2012

Quote:
Originally Posted by MouseBreaker
Посмотреть сообщение
You need ZCMD.inc. Here is the link: https://sampforum.blast.hk/showthread.php?tid=91354
Код:
C:\Users\DarkOrion11\Documents\Test\test.pwn(7448) : error 029: invalid expression, assumed zero
C:\Users\DarkOrion11\Documents\Test\test.pwn(7448) : error 017: undefined symbol "cmd_music"
C:\Users\DarkOrion11\Documents\Test\test.pwn(7448) : error 029: invalid expression, assumed zero



Re: Music on player position - Konstantinos - 20.11.2012

pawn Код:
#include < zcmd >



Re: Music on player position - DarkOrion11 - 20.11.2012

Quote:
Originally Posted by Dwane
Посмотреть сообщение
pawn Код:
#include < zcmd >
I already added.