Music Streaming
#1

Hello, I know it is possible to stream music in-game. I saw some includes but still can't get it.

Like, how do I make a "CMD: playsong/CMD: playstop" and add a function where it plays a music from ******* to all players? And like only level 4+ admins can use it.


Any elaborated help? Thank you a lot.
Reply
#2

Код:
CMD:stopmusic(playerid,params[]) {
	SendClientMessage(playerid, orange,"You have stopped the music!");
	return StopAudioStreamForPlayer(playerid);
}
CMD:playallmusic(playerid,params[]) {
  if(PlayerInfo[playerid][Level] >= 5 || IsPlayerAdmin(playerid)) {
     new url[256];
     if(sscanf(params,"s[256]",url)) return SendClientMessage(playerid,red,"Usage: /playallmusic [url]");
     foreach (new i : Player) if(IsPlayerConnected(i)) PlayAudioStreamForPlayer(i, url);
     new string[128];
     format(string,sizeof string,"Administrator %s Has Run A Music Party To ALL!",pName(playerid));
	 return SendClientMessageToAll(yellow,string);
  } else return SendClientMessage(playerid,COLOR_BRIGHTRED,"ERROR: You need to be rcon to use this command");
}
Reply
#3

For admin verification try this : if(playerAdmin[playerid] < 4) return SendClientMessage(playerid, COLOR_GOLD, "Only admins with level 4+ can use this command.");

next IDK
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)