Music on player position
#1

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

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

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

@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
Reply
#5

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!
Reply
#6

@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"
Reply
#7

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

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

pawn Код:
#include < zcmd >
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)