19.04.2015, 21:10
Maximun;3435726 Wrote:PHP Code:new MusicOn[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/lecture", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(MusicOn[playerid] == 0)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"-| Music |-","Lost Frequencies - Are You With Me","Ecouter","Fermer");
}
}
return 1;
}
if(strcmp(cmd, "/stop", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(MusicOn[playerid] == 1)
{
StopAudioStreamForPlayer(playerid);
MusicOn[playerid] = 0;
SendClientMessage(playerid, -1,"[Music] Vous venez d'arreter la music.");
}
}
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
if(listitem == 0)
{
PlayAudioStreamForPlayer(playerid, "https://www.youtube.com/watch?v=VjHMDlAPMUw");
MusicOn[playerid] = 1;
}
}
return 1;
}
return 0;
}
Ce n'est pas зa. Lа tu as prй-enregistrй ton Stream et surtout ce n'est pas ce qui est demandй. Ce qui est demandй, c'est que tu rentres toi-mкme dans un dialogue de type DIALOG_STYLE_INPUT ton url et que la musique soit dйmarrйe а partir de ton url.