29.01.2015, 15:34
So i wonder how i can use "DIALOG_STYLE_MSGBOX" to later on move on to a "DIALOG_STYLE_LIST" with "CASES" or (Listitem)
#define DIALOG_1 1
#define DIALOG_VEH1 10
#define DIALOG_VEH2 11
#define DIALOG_VEH3 12
// put this below somewhere
ShowPlayerDialog(playerid, DIALOG_1, DIALOG_STYLE_LIST, "Cars", "Veh1\nVeh2\nVeh3", "Choose", "Cancel");
//...
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid)
{
case DIALOG_1: // 1
{
if( !response ) return 1;
switch(listitem)
{
case 0:// Veh1
{
ShowPlayerDialog(playerid, DIALOG_VEH1, DIALOG_STYLE_MSGBOX, "Confirmation", "Are you sure you want to buy this vehicle?", "Hell yeah", "Nope");
}
case 1:// Veh2
{
ShowPlayerDialog(playerid, DIALOG_VEH2, DIALOG_STYLE_MSGBOX, "Confirmation", "Are you sure you want to buy this vehicle?", "Hell yeah", "Nope");
}
case 2:// Veh3
{
ShowPlayerDialog(playerid, DIALOG_VEH3, DIALOG_STYLE_MSGBOX, "Confirmation", "Are you sure you want to buy this vehicle?", "Hell yeah", "Nope");
}
}
}
case DIALOG_VEH1: // 10
{
if( response )
{
SendClientMessage(playerid, -1,"You bought a vehicle! ");
}
}
}
new BuyingCarID[MAX_PLAYERS];
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid)
{
case DIALOG_1: // 1
{
if( !response ) return 1;
switch(listitem)
{
case 0:// Veh1
{
ShowPlayerDialog(playerid, DIALOG_BUYINGCAR, DIALOG_STYLE_MSGBOX, "Confirmation", "Are you sure you want to buy this vehicle?", "Hell yeah", "Nope");
BuyingCarID[playerid] = 411; //infernus
}
case 1:// Veh2
{
ShowPlayerDialog(playerid, DIALOG_BUYINGCAR, DIALOG_STYLE_MSGBOX, "Confirmation", "Are you sure you want to buy this vehicle?", "Hell yeah", "Nope");
BuyingCarID[playerid] = 451; //turismo
}
case 2:// Veh3
{
ShowPlayerDialog(playerid, DIALOG_BUYINGCAR, DIALOG_STYLE_MSGBOX, "Confirmation", "Are you sure you want to buy this vehicle?", "Hell yeah", "Nope");
BuyingCarID[playerid] = 521; //FCR
}
}
}
case DIALOG_BUYINGCAR: // 10
{
if( response )
{
if( BuyingCarID[playerid] == 411)
{
SendClientMessage(playerid, -1,"You bought Infernus! ");
}
else if( BuyingCarID[playerid] == 451)
{
SendClientMessage(playerid, -1,"You bought Turismo! ");
}
//////
}
}
}