CMD:testdialogcmd(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_TESTDIALOG1, DIALOG_STYLE_LIST, "{FF0000}Test Dialogs", "{FF0000}Test Dialog 1:\nTest Item 1\nTest Item 2\nTest Item 3\nTest Item 4\nTest Item 5\n{00FF00}NEXT", "Ok", "");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_TESTDIALOG1)
{
switch(listitem)
{
case 0:
{
//Selected Item: "{FF0000}Test Dialog 1"
}
case 1:
{
//Selected Item: "Test Item 1"
}
case 2:
{
//Selected Item: "Test Item 2"
}
case 3:
{
//Selected Item: "Test Item 3"
}
case 4:
{
//Selected Item: "Test Item 4"
}
case 5:
{
//Selected Item: "Test Item 5"
}
case 6:
{
ShowPlayerDialog(playerid, DIALOG_TESTDIALOG2, DIALOG_STYLE_LIST, "Test Dialogs", "{FF0000}Test Dialog 2:\nTest1\nTest2\nTest3\nTest4\nTest5", "OK", "");
}
}
}
if(dialogid == DIALOG_TESTDIALOG2)
{
switch(listitem)
{
case 0:
{
//Selected Item: "{FF0000}Test Dialog 2"
}
case 1:
{
//Selected Item: "Test1"
}
case 2:
{
//Selected Item: "Test2"
}
case 3:
{
//Selected Item: "Test3"
}
case 4:
{
//Selected Item: "Test4"
}
case 5:
{
//Selected Item: "Test5"
}
}
}
return 1;
}
#include <zcmd>
case 0: { //Selected Item: "{FF0000}Test Dialog 1" } case 1: { cmd_yourcommandname }
Like This ?
pawn Код:
pawn Код:
Код:
#include <zcmd> Код:
case 0: { //Selected Item: "{FF0000}Test Dialog 1" } case 1: { cmd_yourcommandname } |
CommandsDialog(playerid, title[]) // --- Commands Dialog --- // { new string[2048]; strcat(string, "\ /Accept\t\t\t- Accept a duel request\n\ {3C3B3D}________________________________________________________________________\n\ /Buy\t\t\t- Buy a property\n\ {3C3B3D}________________________________________________________________________\n\ /Calc\t\t\t- Calculator\n\ {3C3B3D}________________________________________________________________________\n\ /Carchase\t\t- Locate the Carchase vehicle\n\ {3C3B3D}________________________________________________________________________\n\ "); strcat(string, "\ /Carcolor\t\t- Change your car color\n\ {3C3B3D}________________________________________________________________________\n\ /Chance\t\t- Take a chance\n\ {3C3B3D}________________________________________________________________________\n\ /Color\t\t\t- Change your color\n\ {3C3B3D}________________________________________________________________________\n\ /Deny\t\t\t- Deny a duel request\n\ {3C3B3D}________________________________________________________________________\n\ "); strcat(string, "\ /DM\t\t\t- See a list of Deathmatches\n\ {3C3B3D}________________________________________________________________________\n\ /Duel\t\t\t- Duel a player\n\ {3C3B3D}________________________________________________________________________\n\ /Eject\t\t\t- Eject a player from your vehicle\n\ {3C3B3D}________________________________________________________________________\n\ /Fs\t\t\t- Change your fighting style\n\ "); strcat(string, "\ {3C3B3D}________________________________________________________________________\n\ /Getid\t\t\t- Get a players ID\n\ {3C3B3D}________________________________________________________________________\n\ /Goto\t\t\t- Teleport to a player\n\ {3C3B3D}________________________________________________________________________\n\ /Jetpack\t\t- Get a jackpack\n\ {3C3B3D}________________________________________________________________________\n\ "); strcat(string, "\ /Join\t\t\t- Join a race\n\ {3C3B3D}________________________________________________________________________\n\ /Loadpos\t\t- Load your saved position\n\ {3C3B3D}________________________________________________________________________\n\ /Lock\t\t\t- Lock your vehicles doors\n\ {3C3B3D}________________________________________________________________________\n\ /Myprops\t\t- See a list of properties you own\n\ "); strcat(string, "\ {3C3B3D}________________________________________________________________________\n\ /Nitro\t\t\t- Toggle nitro On / Off\n\ {3C3B3D}________________________________________________________________________\n\ /Para\t\t\t- Get a parachute\n\ {3C3B3D}________________________________________________________________________\n\ /Pay\t\t\t- Give a player some of your money\n\ {3C3B3D}________________________________________________________________________\n\ /PM\t\t\t- Send a private message\n\ "); ShowPlayerDialog(playerid, Cmds_Dialog, MSGBOX, title, string, "Next", "Close"); return 1; }
CommandsDialog(playerid, title[]) // --- Commands Dialog --- //
{
new string[2048];
strcat(string, "\
/Accept\t\t\t- Accept a duel request\n\
{3C3B3D}________________________________________________________________________\n\
/Buy\t\t\t- Buy a property\n\
{3C3B3D}________________________________________________________________________\n\
/Calc\t\t\t- Calculator\n\
{3C3B3D}________________________________________________________________________\n\
/Carchase\t\t- Locate the Carchase vehicle\n\
{3C3B3D}________________________________________________________________________\n\
");
strcat(string, "\
/Carcolor\t\t- Change your car color\n\
{3C3B3D}________________________________________________________________________\n\
/Chance\t\t- Take a chance\n\
{3C3B3D}________________________________________________________________________\n\
/Color\t\t\t- Change your color\n\
{3C3B3D}________________________________________________________________________\n\
/Deny\t\t\t- Deny a duel request\n\
{3C3B3D}________________________________________________________________________\n\
");
strcat(string, "\
/DM\t\t\t- See a list of Deathmatches\n\
{3C3B3D}________________________________________________________________________\n\
/Duel\t\t\t- Duel a player\n\
{3C3B3D}________________________________________________________________________\n\
/Eject\t\t\t- Eject a player from your vehicle\n\
{3C3B3D}________________________________________________________________________\n\
/Fs\t\t\t- Change your fighting style\n\
");
strcat(string, "\
{3C3B3D}________________________________________________________________________\n\
/Getid\t\t\t- Get a players ID\n\
{3C3B3D}________________________________________________________________________\n\
/Goto\t\t\t- Teleport to a player\n\
{3C3B3D}________________________________________________________________________\n\
/Jetpack\t\t- Get a jackpack\n\
{3C3B3D}________________________________________________________________________\n\
");
strcat(string, "\
/Join\t\t\t- Join a race\n\
{3C3B3D}________________________________________________________________________\n\
/Loadpos\t\t- Load your saved position\n\
{3C3B3D}________________________________________________________________________\n\
/Lock\t\t\t- Lock your vehicles doors\n\
{3C3B3D}________________________________________________________________________\n\
/Myprops\t\t- See a list of properties you own\n\
");
strcat(string, "\
{3C3B3D}________________________________________________________________________\n\
/Nitro\t\t\t- Toggle nitro On / Off\n\
{3C3B3D}________________________________________________________________________\n\
/Para\t\t\t- Get a parachute\n\
{3C3B3D}________________________________________________________________________\n\
/Pay\t\t\t- Give a player some of your money\n\
{3C3B3D}________________________________________________________________________\n\
/PM\t\t\t- Send a private message\n\
");
strcat(string, "{FF0000}NEXT");
ShowPlayerDialog(playerid, DIALOG_Cmds_Dialog, MSGBOX, title, string, "OK", "Close");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_Cmds_Dialog)
{
switch(listitem)
{
case 0:
{
//Selected Item: "{FF0000}Cmds Dialog 1"
}
case 1:
{
//Strcat Code: "1"
}
case 2:
{
//Strcat Code: "2"
}
case 3:
{
//Strcat Code: "3"
}
case 4:
{
//Strcat Code: "4"
}
case 5:
{
//Strcat Code: "5"
}
case 6:
{
//Strcat Code: "6"
}
case 7:
{
ShowPlayerDialog(playerid, DIALOG_Cmds_Dialog2, DIALOG_STYLE_LIST, "Title = Test", "{FF0000}Test Dialog 2:\nTest1\nTest2\nTest3\nTest4\nTest5", "OK", "");
}
}
}
if(dialogid == DIALOG_Cmds_Dialog2)
{
switch(listitem)
{
case 0:
{
//Selected Item: "{FF0000}Cmds Dialog 2"
}
case 1:
{
//Selected Item: "Test1"
}
case 2:
{
//Selected Item: "Test2"
}
case 3:
{
//Selected Item: "Test3"
}
case 4:
{
//Selected Item: "Test4"
}
case 5:
{
//Selected Item: "Test5"
}
}
}
return 1;
}
#include <YSI\y_inline>
#include <YSI\y_dialog>
#include <YSI\y_commands>
CMD:testdialog(playerid, arg[])
{
inline ViewInfo(vpid, vdialogid, vresponse, vlistitem, string:vtext[])
{
#pragma unused vlistitem, vdialogid, vpid, vtext
if(vresponse)
{
inline ShowInfo(spid, sdialogid, sresponse, slistitem, string:stext[])
{
#pragma unused slistitem, sdialogid, spid, stext
if(sresponse) SendClientMessage(playerid, -1, "You closed the info box with ok!");
else SendClientMessage(playerid, -1, "You closed the info box with cancel!");
}
Dialog_ShowCallback(playerid, using inline ShowInfo, DIALOG_STYLE_MSGBOX, "Info", "This is a inline dialog", "Ok", "Close");
}
else SendClientMessage(playerid, -1, "You chose not to see the info box!");
}
Dialog_ShowCallback(playerid, using inline ViewInfo, DIALOG_STYLE_MSGBOX, "Show info?", "Info", "Show", "Close");
return 1;
}