Dialog not displaying
#1

For some reason, when I click an option in a list dialog, nothing appears on the screen. I've been looking through the code, but I can't spot where I made the mistake, it's almost identical to the wiki one.

Код:
#define TRUCK_FIRST_DIALOG 12900

ShowPlayerDialog(playerid, TRUCK_FIRST_DIALOG, DIALOG_STYLE_LIST, "Trucking missions", "Select a random route\nSelect your own trucking route", "OK", "Exit");
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == TRUCK_FIRST_DIALOG)
	{
	    if(response)
	    {
			if(listitem == 0)
			{
				SendClientMessage(playerid, RED, "The option is currently disabled. We apologize for any inconvenience caused.");
			}

			if(listitem == 1)
			{
				if(GetVehicleTrailer(GetPlayerVehicleID(playerid)) == 435) // Refrigerated Trailer
				{
			    	ShowPlayerDialog(playerid, NORMAL_ROUTE_GOODS, DIALOG_STYLE_LIST, "Choose goods to carry", "Electricals\nTyres\nGroceries\nFrozen food\nMeat\nSausages\nDrinks\nFurniture\nOffice Equipment", "OK", "Exit");
	   			}
	   			
	   			if(GetVehicleTrailer(GetPlayerVehicleID(playerid)) == 450) // Coal Trailer
	   			{
	   			    ShowPlayerDialog(playerid, COAL_ROUTE_GOODS, DIALOG_STYLE_LIST, "Choose goods to carry", "Coal\nGravel", "OK", "Exit");
			    }
			    
			    if(GetVehicleTrailer(GetPlayerVehicleID(playerid)) == 584) // Petrol Trailer
	   			{
	   			    ShowPlayerDialog(playerid, TANKER_ROUTE_GOODS, DIALOG_STYLE_LIST, "Choose goods to carry", "Petrol\nDiesel", "OK", "Exit");
			    }
 			}
 		}
		return 1;
	}
return 0;
}
P.S - The forums ruin the indentation a bit.
Reply
#2

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == TRUCK_FIRST_DIALOG)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SendClientMessage(playerid, RED, "The option is currently disabled. We apologize for any inconvenience caused.");
            }

            if(listitem == 1)
            {
                if(GetVehicleTrailer(GetPlayerVehicleID(playerid)) == 435) // Refrigerated Trailer
                {
                    ShowPlayerDialog(playerid, NORMAL_ROUTE_GOODS, DIALOG_STYLE_LIST, "Choose goods to carry", "Electricals\nTyres\nGroceries\nFrozen food\nMeat\nSausages\nDrinks\nFurniture\nOffice Equipment", "OK", "Exit");
                }
               
                if(GetVehicleTrailer(GetPlayerVehicleID(playerid)) == 450) // Coal Trailer
                {
                    ShowPlayerDialog(playerid, COAL_ROUTE_GOODS, DIALOG_STYLE_LIST, "Choose goods to carry", "Coal\nGravel", "OK", "Exit");
                }
               
                if(GetVehicleTrailer(GetPlayerVehicleID(playerid)) == 584) // Petrol Trailer
                {
                    ShowPlayerDialog(playerid, TANKER_ROUTE_GOODS, DIALOG_STYLE_LIST, "Choose goods to carry", "Petrol\nDiesel", "OK", "Exit");
                }
            }
        }
        return 1;
    }
return 1;
}
Reply
#3

Doesn't work. Btw, I also have other dialog defines, so I assume the final return closing OnDialogResponse should be return 1, instead of return 0. That doesn't however work either.
Reply
#4

Bump.
Reply
#5

Lol Change the id to like 1237 and its should work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)