if(dialogid == 371)
{
if(!response)
{
SendClientMessage(playerid,COLOR_YELLOW,"You exit from dialog!");
return 1; I was try with return and without it but it doens't send anything if I press Exit in dialog
}
if(response)
{
//here is code for house buy
}
}]
if(dialogid == 371)
{
if(response)
{
//code for response
}
else //if player click cancel or something
{
and I click cancel but nothing happens but I put some text if player click cancel
}
}
new message1[256];
format(message1,sizeof(message1),"{33AA33}This vehicle is renting!\n\n{FFFFFF}The price of vehicle: {33AA33}%d$\n\n{FFFFFF}Click on {33AA33}Rent {FFFFFF}or {33AA33}Cancel",RentACar2[x][2]);
ShowPlayerDialog(playerid,371,DIALOG_STYLE_MSGBOX,"{33AA33}Rent Car",message1,"Rent","Cancel");
// This callback gets called when a player interacts with a dialog
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
// Select the proper dialog to process
switch (dialogid)
{
case DialogSupportSettings: Dialog_SupportSettings(playerid, response, listitem); // Process the SupportSettings main-menu
case DialogNewGlobConsumptionMul: Dialog_NewGlobConsumptionMul(playerid, response, inputtext); // Process the value given for a new GlobalConsumptionMul setting
case DialogNewPricePerLitre: Dialog_NewPricePerLitre(playerid, response, inputtext); // Process the value given for a new PricePerLitre setting
case DialogNewFinePerUnit: Dialog_NewFinePerUnit(playerid, response, inputtext); // Process the value given for a new FinePerUnit setting
case DialogRegister: Dialog_Register(playerid, response, inputtext); // The "Register"-dialog
case DialogLogin: Dialog_Login(playerid, response, inputtext); // The "Login"-dialog
case DialogSelectVehicleClass: Dialog_SelectVehicleClass(playerid, response, listitem); // Process the chosen vehicle-class when using the /v or /editv commands
case DialogSelectVehicle: Dialog_SelectVehicle(playerid, response, listitem); // Spawn a vehicle with /v or edit it's model-data using /editv
case DialogSelectVehicleModelData: Dialog_SelectVehicleModelData(playerid, response, listitem); // Process the chosen vehiclemodel-data to be edited
case DialogVModelNewPrice: Dialog_VModelNewPrice(playerid, response, inputtext);
case DialogVModelNewMaxFuel: Dialog_VModelNewMaxFuel(playerid, response, inputtext);
case DialogVModelNewConsumption: Dialog_VModelNewConsumption(playerid, response, inputtext);
case DialogVModelNewRefuelTime: Dialog_VModelNewRefuelTime(playerid, response, inputtext);
case DialogBuyCompany: Dialog_BuyCompany(playerid, response);
case DialogBuyCompanyAskName: Dialog_BuyCompanyAskName(playerid, response, inputtext);
case DialogInviteToCompany: Dialog_InviteToCompany(playerid, response);
case DialogCompanyData: Dialog_CompanyData(playerid, response, listitem);
case DialogCompanyLeave: Dialog_CompanyLeave(playerid, response);
}
// A filterscript should always return 0 here, otherwise the other filterscripts and the gamemode cannot process any dialog
return 0;
}
Returning 0 in this callback will pass the dialog to another script in case no matching code were found in your gamemode's callback. |