Dialog list can't choose an option
#1

I am unable to choose one of the vehicle options...it does the same as it would if I were to press cancel

Код:
public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{

	new
	    Float:Pos[4]={-1969.3022, 309.2212, 34.9013},
	    ivModel,
	    ivPrice,
	    ivColors[2];
	if(dialogid == DIALOG_CARBUY&& Total_Player_Vehicles[playerid]<= MAX_OWNABLE_VEH&& Total_Veh_Created < MAX_BUYABLE_VEH)
	{
		if(!response){ShowPlayerDialog(playerid, -1, DIALOG_STYLE_LIST, "", "", "", "");}
		else
		{
			switch(listitem)
			{
				case 0:
				{
					ivModel = VEH1;
				}
				case 1:
				{
					ivModel = VEH2;
				}
				case 2:
				{
					ivModel = VEH3;
				}
				case 3:
				{
					ivModel = VEH4;
				}
			}
		}
	}
Код:
public OnPlayerEnterDynamicCP(playerid,checkpointid)
{
	if(checkpointid == CP_CARBUY)
	{
	    ShowPlayerDialog(playerid,DIALOG_CARBUY,DIALOG_STYLE_LIST,"Ottos Vehicle Dealership","Infernus($1,000,000)\nSuper GT($1,200,000)\nUranus($700,000)\nNRG-500($900,000)","Buy","Cancel");
	}
}
Reply
#2

i don't understand what's your problem? every List is not responding or only 1?
Reply
#3

Try this code now.
pawn Код:
public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{

    new
        Float:Pos[4]={-1969.3022, 309.2212, 34.9013},
        ivModel,
        ivPrice,
        ivColors[2];
    if(dialogid == DIALOG_CARBUY&& Total_Player_Vehicles[playerid]<= MAX_OWNABLE_VEH&& Total_Veh_Created < MAX_BUYABLE_VEH)
    {
        if(!response) return ShowPlayerDialog(playerid, -1, DIALOG_STYLE_LIST, "", "", "", "");
        else
        {
            switch(listitem)
            {
                case 0:
                {
                    ivModel = VEH1;
                }
                case 1:
                {
                    ivModel = VEH2;
                }
                case 2:
                {
                    ivModel = VEH3;
                }
                case 3:
                {
                    ivModel = VEH4;
                }
            }
        }
    }
}
Reply
#4

I've had the same problem myself but that was in a FS. If you have it in a FS then "return 0;" at all other scripts OnDialogResponse, if it's in your GM if you do not have any FS's connected in the server.cfg "return 1;" at the bottom of OnDialogResponse. Or else no idea?
Reply
#5

Ballu Miaa That didn't work it still cancels when I choose any of the options on the list
Reply
#6

pawn Код:
public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{

    new
        Float:Pos[4]={-1969.3022, 309.2212, 34.9013},
        ivModel,
        ivPrice,
        ivColors[2];
    if(dialogid == DIALOG_CARBUY&& Total_Player_Vehicles[playerid]<= MAX_OWNABLE_VEH&& Total_Veh_Created < MAX_BUYABLE_VEH)
    {
            switch(listitem)
            {
                case 0:
                {
                    ivModel = VEH1;
                }
                case 1:
                {
                    ivModel = VEH2;
                }
                case 2:
                {
                    ivModel = VEH3;
                }
                case 3:
                {
                    ivModel = VEH4;
                }
          }
     }
}
Reply
#7

nope :/
Reply
#8

I dont think there is anything wrong with the dialog script, it should work and it is proberbly something wrong with "return" on the bottom of OnDialogResponse. Post all of the OnDialogResponse and tell what kind of filterscripts you have, if you have some, and i'll see what i can do.
Reply
#9

First of all. By looking at your code i dont think you coded something which will work. I dont know what you have done cause it just looks like a Default format for showing a dialog box?

pawn Код:
if(!response){ShowPlayerDialog(playerid, -1, DIALOG_STYLE_LIST, "", "", "", "");}
        else
        {
            switch(listitem)
            {
                case 0:
                {
                    ivModel = VEH1;
                }
                case 1:
                {
                    ivModel = VEH2;
                }
                case 2:
                {
                    ivModel = VEH3;
                }
                case 3:
                {
                    ivModel = VEH4;
                }
            }
        }
Explain this please. What are you exactly doing with all this code?
Reply
#10

Maybe you should try this. And i dont understand what this code is for eather.

Код:
public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{

    new
        Float:Pos[4]={-1969.3022, 309.2212, 34.9013},
        ivModel,
        ivPrice,
        ivColors[2];
    if(dialogid == DIALOG_CARBUY&& Total_Player_Vehicles[playerid]<= MAX_OWNABLE_VEH&& Total_Veh_Created < MAX_BUYABLE_VEH)
    {
        if(!response) return ShowPlayerDialog(playerid, -1, DIALOG_STYLE_LIST, "", "", "", "");
        else
        {
			if (listitem == 0)
			{
				ivModel = VEH1;
			}
			else if(listitem == 1)
			{
				ivModel = VEH2;
			}
			else if(listitem == 2)
			{
				ivModel = VEH3;
			}
			else if(listitem == 3)
			{
				ivModel = VEH4;
			}
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)