26.12.2014, 19:15
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.
Or if you want it for RCON only:
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;
}
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;
}