Guest User

[CODE] Pegar Musica do Youtube

a guest
Dec 4th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.22 KB | None | 0 0
  1. //=============== QUANDO CONECTAR ==========================================================
  2. public OnPlayerConnect(playerid)
  3. {
  4.     PlayAudioStreamForPlayer(i, "https://6t.pe/?song=NOME DA MUSICA AQUI");
  5. }
  6.  
  7. //=============== CASO QUEIRA USAR COMO COMANDO ==========================================================
  8. public OnPlayerCommandText(playerid, cmdtext[])
  9. {
  10.     new cmd[256],string[256];
  11.     if(strcmp("/musica", cmd, true) == 0)// tocar musica somente pra quem digito
  12.     {
  13.         new texto[128];
  14.         if(sscanf(cmdtext, "s[4]s[128]", cmd, texto))
  15.         {
  16.             SendClientMessage(playerid, Vermelho, "Digite: /musica[titulo]");
  17.         }
  18.         else
  19.         {
  20.             format(string, sizeof(string), "https://6t.pe/?song=%s", texto);
  21.             PlayAudioStreamForPlayer(i, string);
  22.         }
  23.         return 1;
  24.     }
  25.  
  26.     if(strcmp("/musicaall", cmd, true) == 0)// tocar musica pra todo mundo
  27.     {
  28.         new texto[128];
  29.         if(sscanf(cmdtext, "s[4]s[128]", cmd, texto))
  30.         {
  31.             SendClientMessage(playerid, Vermelho, "Digite: /musicaall [titulo]");
  32.         }
  33.         else
  34.         {
  35.             format(string, sizeof(string), "https://6t.pe/?song=%s", texto);
  36.             for(new i; i < MAX_PLAYERS; i ++)
  37.             {
  38.                 if(IsPlayerConnected(i))
  39.                 {
  40.                     PlayAudioStreamForPlayer(i, string);
  41.                 }
  42.             }
  43.         }
  44.         return 1;
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment