CMD:mydialogcommand(playerid, params[])
{
}
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select a Location", "24/7\n Ammunation\n Crack Den", "Select", "Cancel");
enum
{
DIALOG_NAME
}
#define DIALOG_NAME 1
// Then we could use the DialogID as DIALOG_NAME
.CMD:mydialogcommand(playerid, params[])
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select a Location", "24/7\n Ammunation\n Crack Den", "Select", "Cancel");
}
if(response){
}
else {
SendClientMessage(playerid, YourColor, "You have cancelled");
}
if(response){
switch(dialogid) //Switching to check for dialog id's
{
case 1: //This is our dialog ID for our List Item
{
switch(listitem) // We will now be looking at list items
{
case 0: // This is the first list item, the 24/7
{
SendClientMessage(playerid, YourColor, "You have now teleported to the 24/7");
SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);
SetPlayerInterior(playerid, 17);
}
case 1: // This is the second list item, the Ammunation
{
SendClientMessage(playerid, YourColor, "You have now teleported to the Ammunation");
SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);
SetPlayerInterior(playerid, 1);
}
case 2: // This is the final list item, the CrackDen
{
SendClientMessage(playerid, YourColor, "You have now teleported to the Crack Den");
SetPlayerPos(playerid, 318.564971,1118.209960,1083.88281);
SetPlayerInterior(playerid, 5);
}
}
}
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response){
switch(dialogid) //Switching to check for dialog id's
{
case 1: //This is our dialog ID for our List Item
{
switch(listitem) // We will now be looking at list items
{
case 0: // This is the first list item, the 24/7
{
SendClientMessage(playerid, YourColor, "You have now teleported to the 24/7");
SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);
SetPlayerInterior(playerid, 17);
}
case 1: // This is the second list item, the Ammunation
{
SendClientMessage(playerid, YourColor, "You have now teleported to the Ammunation");
SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);
SetPlayerInterior(playerid, 1);
}
case 2: // This is the final list item, the CrackDen
{
SendClientMessage(playerid, YourColor, "You have now teleported to the Crack Den");
SetPlayerPos(playerid, 318.564971,1118.209960,1083.88281);
SetPlayerInterior(playerid, 5);
}
}
}
}
}
else {
SendClientMessage(playerid, YourColor, "You have cancelled");
}
}
/ZCMD Commands
CMD:mydialogcommand(playerid, params[])
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select a Location", "24/7\n Ammunation\n Crack Den", "Select", "Cancel");
}
|
Well I agree with [Lexi].There way out more tutorials about this and tutorials at samp wiki as well.Think of something new.
|