SA-MP Forums Archive
dialog help - 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 help (/showthread.php?tid=497722)



dialog help - Ben_Leto - 28.02.2014

when i open picture of dialog there are written 2 sentences at the first sentence theres writtened test1 and at the second sentence there is test 2 when i click test2 the dialog tab is closing can u say why?
code
Код:
#include <a_samp>
#define CLS1 12
#if defined FILTERSCRIPT
#else

#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/dialogshow", cmdtext, true, 10) == 0)
	{
		ShowPlayerDialog(playerid,CLS1,DIALOG_STYLE_LIST,"Airchiet Damxmare Dzala","test1\ntest2","Select","Cancel");
		return 1;
	}
	return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(response)
	{
		switch(dialogid == CLS1)
		{
	        case 0:
	        {
		   GivePlayerWeapon(playerid,31,500);
		}
	        case 1:
	        {
	            GivePlayerWeapon(playerid,25,250);
		}
	}
}
return 0;
}



Re: dialog help - Konstantinos - 28.02.2014

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch (dialogid)
    {
        case CLS1:
        {
            if (response)
            {
                switch (listitem)
                {
                    case 0: GivePlayerWeapon(playerid,31,500);
                    case 1: GivePlayerWeapon(playerid,25,250);
                }
            }
            return 1;
        }
    }
    return 0;
}
After selecting a list item, it will close the dialog and give the weapon.


Re: dialog help - Ben_Leto - 28.02.2014

no man this not working