if(strcmp(cmd, "/heal", true) == 0)
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, Dialog Title"", MenuItems"", Button 1: "Stop Music", Button 2:"Exit");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Music Player", "Music No 1\nNo 2\n No 3\n No 4\n No5", "Stop Music", "Exit");
if(strcmp(cmd, "/music", true) == 0)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Music Player", "Music No 1\nNo 2\n No 3\n No 4\n No5", "Stop Music", "Exit");
return 1;
}
dcmd_music(playerid, params[])
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Music Player", "Music No 1\nNo 2\n No 3\n No 4\n No5", "Stop Music", "Exit");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(music, 5, cmdtext);
return 0;
}
public OnDialogResponse
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2)
{
if(response)
{
switch(listitem)
{
case 0:
{
//Selected Item: "Music No 1"
}
case 1:
{
//Selected Item: "No 2"
}
case 2:
{
//Selected Item: " No 3"
}
case 3:
{
//Selected Item: " No 4"
}
case 4:
{
//Selected Item: " No5"
}
}
}
else
{
//The player has pressed "Stop Music".
switch(listitem
{
case 0:
{
//Selected Item: "Music No 1"
}
case 1:
{
//Selected Item: "No 2"
}
case 2:
{
//Selected Item: " No 3"
}
case 3:
{
//Selected Item: " No 4"
}
case 4:
{
//Selected Item: " No5"
}
}
}
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2)
{
if(response)
{
switch(listitem))
{
case 0:
{
//Selected Item: "Music No 1"
PlayAudioStreamForPlayer(playerid, "http://brp.comlu.com/downloads/loginaudio.mp3");
return 1;
}
case 1:
{
//Selected Item: "No 2"
PlayAudioStreamForPlayer(playerid, "http://brp.comlu.com/downloads/loginaudio.mp3");
return 1;
}
case 2:
{
//Selected Item: " No 3"
PlayAudioStreamForPlayer(playerid, "http://brp.comlu.com/downloads/loginaudio.mp3");
return 1;
}
case 3:
{
//Selected Item: " No 4"
PlayAudioStreamForPlayer(playerid, "http://brp.comlu.com/downloads/loginaudio.mp3");
return 1;
}
case 4:
{
//Selected Item: " No5"
PlayAudioStreamForPlayer(playerid, "http://brp.comlu.com/downloads/loginaudio.mp3");
return 1;
}
}
}
else
{
//The player has pressed "Stop Music".
StopAudioStreamForPlayer(playerid);
switch(listitem
{
case 0:
{
//Selected Item: "Music No 1"
StopAudioStreamForPlayer(playerid);
return 1;
}
case 1:
{
//Selected Item: "No 2"
StopAudioStreamForPlayer(playerid);
return 1;
}
case 2:
{
//Selected Item: " No 3"
StopAudioStreamForPlayer(playerid);
return 1;
}
case 3:
{
//Selected Item: " No 4"
StopAudioStreamForPlayer(playerid);
return 1;
}
case 4:
{
//Selected Item: " No5"
StopAudioStreamForPlayer(playerid);
return 1;
}
}
}
}
return 0;
}
For what reason, within every comment or response you make comes nothing generally productive? Are you just 'hunting' for posts? I'm just a bit curious.
|
...
switch(listitem
{
case 0:
{
//Selected Item: "Music No 1"
StopAudioStreamForPlayer(playerid);
return 1;
}
case 1:
{
//Selected Item: "No 2"
StopAudioStreamForPlayer(playerid);
return 1;
}
case 2:
{
//Selected Item: " No 3"
StopAudioStreamForPlayer(playerid);
return 1;
}
case 3:
{
//Selected Item: " No 4"
StopAudioStreamForPlayer(playerid);
return 1;
}
case 4:
{
//Selected Item: " No5"
StopAudioStreamForPlayer(playerid);
return 1;
}
}
In fact, I am, read the so called "tutorial", and you'll know what I mean.
And who the hell even bumps his own tutorial for comments ?, usually people who don't get comments means that people don't find the following thread considered as a tutorial. |