Music play for all - 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 play for all (
/showthread.php?tid=552813)
Music play for all -
Hostoxide - 26.12.2014
How to play music play for all players ? example /music [link]...
Re: Music play for all -
HY - 26.12.2014
pawn Код:
CMD:music(playerid, params[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, ''Link Here'');
}
return 1;
}
Re: Music play for all -
AlexSwezVotra - 26.12.2014
Quote:
Originally Posted by HY
pawn Код:
CMD:music(playerid, params[]) { for(new i = 0; i < MAX_PLAYERS; i++) { PlayAudioStreamForPlayer(i, ''Link Here''); } return 1; }
|
This.
Re: Music play for all -
jackx3rx - 26.12.2014
He asked specifically for a command where you type "/music URL" ingame, so you choose your music without having to edit it in the script.
pawn Код:
CMD:music(playerid, params[])
{
new url[128];
if(sscanf(params,"s[128]",url)) return SendClientMessage(playerid,-1,"USAGE: /music (url)");
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, url);
}
return 1;
}
Or if you want it for RCON only:
pawn Код:
CMD:music(playerid, params[])
{
if(!PlayerIsAdmin(playerid)) return SendClientMessage(playerid,-1,"ERROR: Only administrators may use this command.");
{
new url[128];
if(sscanf(params,"s[128]",url)) return SendClientMessage(playerid,-1,"USAGE: /music (url)");
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, url);
}
}
return 1;
}