ok so I am trying to transform a car tuning menu. I want to make it have dialogs instead of menus. After completing a small part of it i compiled the script with no incident. But when I tested it, I noticed only the 1st list choice was working. I made 2 dialogs so far. The 1st item from the dialog ID 1 is supposed to open the dialog ID 2. It opens it successfully, but only the 1st option from the second dialog is working. if I access another one, the dialog just disappears. Can someone tell me what is wrong with my code?
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response == 1)
{
switch(listitem)// Checking which list item was selected
{
case 0:// Paintjobs
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close");
}
case 1: // Colors
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nGreen 2\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close");
}
case 2: // Exhausts
{
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Exhausts", "Alien\nX-Flow\nChromer\nSlamin\n \nBack", "Apply", "Close");
}
case 3: // Front Bumpers
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Front Bumpers", "Alien\nX-Flow\nChromer\nSlamin\n \nBack", "Apply", "Close");
}
case 4: // Rear Bumpers
{
ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Rear Bumpers", "Alien\nX-Flow\nChromer\nSlamin\n \nBack", "Apply", "Close");
}
case 5: // Roofs
{
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Roofs", "Alien\nX-Flow\nLocos Hardtop Roof\nLocos Softtop Roof\n \nBack", "Apply", "Close");
}
case 6: // Spoilers
{
ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Spoilers", "Alien\nX-Flow\n\nBack", "Apply", "Close");
}
case 7: // Side Skirts
{
ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, "Side Skirts", "Alien Side Skirt\nX-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\n \nBack", "Apply", "Close");
}
case 8: // Bullbars
{
ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, "Bullbars", "Locos Chrome Grill\nLocos Chrome Bars\nLocos Chrome Lights \nLocos Chrome Bullbar\n \nBack", "Apply", "Close");
}
case 9: // Wheels
{
ShowPlayerDialog(playerid, 11, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImportn\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close");
}
case 10: // Car Stereo
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_LIST, "Car Stereo", "Bass Boost\n \nBack", "Apply", "Close");
}
case 11: // Hydraulics
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_LIST, "Hydaulics", "Hydaulics\n \nBack", "Apply", "Close");
}
case 12: // Nitrous Oxide
{
ShowPlayerDialog(playerid, 14, DIALOG_STYLE_LIST, "Nitrous Oxide", "2x Nitrous\n5x Nitrous\n10x Nitrous\n \nBack", "Apply", "Close");
}
case 13: // Repair Car
{
new car = GetPlayerVehicleID(playerid);
SetVehicleHealth(car,1000);
SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repaired car");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Car Tuning Menu", "Paint Jobs\nColors\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close");
return 1;
}
}
}
}
if(dialogid == 2)
{
if(response == 1)
{
switch(listitem)// Checking which listitem was selected
{
case 0:
{
if(pmodelid[playerid] == 562 ||
pmodelid[playerid] == 565 ||
pmodelid[playerid] == 559 ||
pmodelid[playerid] == 561 ||
pmodelid[playerid] == 560 ||
pmodelid[playerid] == 575 ||
pmodelid[playerid] == 534 || // Broadway
pmodelid[playerid] == 567 ||
pmodelid[playerid] == 536 ||
pmodelid[playerid] == 535 ||
pmodelid[playerid] == 576 ||
pmodelid[playerid] == 558)
{
new car = GetPlayerVehicleID(playerid);
ChangeVehiclePaintjob(car,0);
SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added paintjob to car");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close");
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] Paintjob is only for Wheel Arch Angrls and Loco Low Co types of cars");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close");
}
}
case 1:
{
if(pmodelid[playerid] == 562 ||
pmodelid[playerid] == 565 ||
pmodelid[playerid] == 559 ||
pmodelid[playerid] == 561 ||
pmodelid[playerid] == 560 ||
pmodelid[playerid] == 575 ||
pmodelid[playerid] == 534 || // Broadway
pmodelid[playerid] == 567 ||
pmodelid[playerid] == 536 ||
pmodelid[playerid] == 535 ||
pmodelid[playerid] == 576 ||
pmodelid[playerid] == 558)
{
new car = GetPlayerVehicleID(playerid);
ChangeVehiclePaintjob(car,1);
SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added paintjob to car");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close");
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] Paintjob is only for Wheel Arch Angrls and Loco Low Co types of cars");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close");
}
}
case 2:
{
if(pmodelid[playerid] == 562 ||
pmodelid[playerid] == 565 ||
pmodelid[playerid] == 559 ||
pmodelid[playerid] == 561 ||
pmodelid[playerid] == 560 ||
pmodelid[playerid] == 575 ||
pmodelid[playerid] == 534 || // Broadway
pmodelid[playerid] == 567 ||
pmodelid[playerid] == 536 ||
pmodelid[playerid] == 535 ||
pmodelid[playerid] == 576 ||
pmodelid[playerid] == 558)
{
new car = GetPlayerVehicleID(playerid);
ChangeVehiclePaintjob(car,2);
SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added paintjob to car");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close");
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] Paintjob is only for Wheel Arch Angrls and Loco Low Co types of cars");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close");
}
}
case 3:
{
if(pmodelid[playerid] == 562 ||
pmodelid[playerid] == 565 ||
pmodelid[playerid] == 559 ||
pmodelid[playerid] == 561 ||
pmodelid[playerid] == 560 ||
pmodelid[playerid] == 575 ||
pmodelid[playerid] == 534 || // Broadway
pmodelid[playerid] == 567 ||
pmodelid[playerid] == 536 ||
pmodelid[playerid] == 535 ||
pmodelid[playerid] == 576 ||
pmodelid[playerid] == 558)
{
new car = GetPlayerVehicleID(playerid);
ChangeVehiclePaintjob(car,3);
SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added paintjob to car");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close");
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] Paintjob is only for Wheel Arch Angrls and Loco Low Co types of cars");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close");
}
}
case 4:
{
if(pmodelid[playerid] == 562 ||
pmodelid[playerid] == 565 ||
pmodelid[playerid] == 559 ||
pmodelid[playerid] == 561 ||
pmodelid[playerid] == 560 ||
pmodelid[playerid] == 575 ||
pmodelid[playerid] == 534 || // Broadway
pmodelid[playerid] == 567 ||
pmodelid[playerid] == 536 ||
pmodelid[playerid] == 535 ||
pmodelid[playerid] == 576 ||
pmodelid[playerid] == 558)
{
new car = GetPlayerVehicleID(playerid);
ChangeVehiclePaintjob(car,4);
SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added paintjob to car");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close");
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] Paintjob is only for Wheel Arch Angrls and Loco Low Co types of cars");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close");
}
}
case 5:
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close");
}
case 6:
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Car Tuning Menu", "Paint Jobs\nColors\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close");
}
}
return 1;
}
}
return 1;
}