SA-MP Forums Archive
Dialog list can't choose an option - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog list can't choose an option (/showthread.php?tid=337707)



Dialog list can't choose an option - vvhy - 27.04.2012

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");
	}
}



Re: Dialog list can't choose an option - Rudy_ - 27.04.2012

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


Re: Dialog list can't choose an option - Ballu Miaa - 27.04.2012

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;
                }
            }
        }
    }
}



Re: Dialog list can't choose an option - HDFord - 27.04.2012

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?


Re: Dialog list can't choose an option - vvhy - 27.04.2012

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


Re: Dialog list can't choose an option - Ballu Miaa - 27.04.2012

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;
                }
          }
     }
}



Re: Dialog list can't choose an option - vvhy - 27.04.2012

nope :/


Re: Dialog list can't choose an option - HDFord - 27.04.2012

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.


Re: Dialog list can't choose an option - Ballu Miaa - 27.04.2012

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?


Re: Dialog list can't choose an option - HDFord - 27.04.2012

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;
			}
        }
    }
}