SA-MP Forums Archive
What is wrong with this menu - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What is wrong with this menu (/showthread.php?tid=192599)



What is wrong with this menu - yarrum3 - 23.11.2010

Im trying to make a menu and i cant work out why only list item one will only work.

here is the code

pawn Код:
#define GUNPACKAGES 5656

pawn Код:
ShowPlayerDialog(playerid, GUNPACKAGES, DIALOG_STYLE_LIST,"Gun Packages"," PeeWee Package\nGangster package\nOG Package\n", "Enter", "Cancel");

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == GUNPACKAGES)
    {
        if(listitem == 0)
        {
            GivePlayerWeapon(playerid,1,900);
            GivePlayerWeapon(playerid,16,900);
            GivePlayerWeapon(playerid,22,900);
            GivePlayerWeapon(playerid,25,900);
            GivePlayerWeapon(playerid,29,900);
        }
        if(listitem == 1)
        {
            GivePlayerWeapon(playerid,9,900);
            GivePlayerWeapon(playerid,16,900);
            GivePlayerWeapon(playerid,24,900);
            GivePlayerWeapon(playerid,26,900);
            GivePlayerWeapon(playerid,28,900);
        }
        if(listitem == 2)
        {
            GivePlayerWeapon(playerid,5,900);
            GivePlayerWeapon(playerid,18,900);
            GivePlayerWeapon(playerid,24,900);
            GivePlayerWeapon(playerid,27,900);
            GivePlayerWeapon(playerid,31,900);
            GivePlayerWeapon(playerid,32,900);
        }
    }
   
    return 0;
}
I don't get any errors but it will only give me the guns from the first thing on the menu.


Re: What is wrong with this menu - BMUK - 23.11.2010

Works fine for me.


Re: What is wrong with this menu - ExeC - 23.11.2010

pawn Код:
ShowPlayerDialog(playerid, GUNPACKAGES, DIALOG_STYLE_LIST,"Gun Packages"," PeeWee Package\nGangster package\nOG Package\n", "Enter", "Cancel");
Maybe you should remove the last
pawn Код:
\n
pawn Код:
ShowPlayerDialog(playerid, GUNPACKAGES, DIALOG_STYLE_LIST,"Gun Packages","PeeWee Package \nGangster package \nOG Package", "Enter", "Cancel");
Hope it works :S

EDIT:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == GUNPACKAGES)
    {
       if(response)
       {
        if(listitem == 0)
        {
            GivePlayerWeapon(playerid,1,900);
            GivePlayerWeapon(playerid,16,900);
            GivePlayerWeapon(playerid,22,900);
            GivePlayerWeapon(playerid,25,900);
            GivePlayerWeapon(playerid,29,900);
        }
        if(listitem == 1)
        {
            GivePlayerWeapon(playerid,9,900);
            GivePlayerWeapon(playerid,16,900);
            GivePlayerWeapon(playerid,24,900);
            GivePlayerWeapon(playerid,26,900);
            GivePlayerWeapon(playerid,28,900);
        }
        if(listitem == 2)
        {
            GivePlayerWeapon(playerid,5,900);
            GivePlayerWeapon(playerid,18,900);
            GivePlayerWeapon(playerid,24,900);
            GivePlayerWeapon(playerid,27,900);
            GivePlayerWeapon(playerid,31,900);
            GivePlayerWeapon(playerid,32,900);
        }
    }
   
    return 0;
}
pawn Код:
if(response)
{



Re: What is wrong with this menu - yarrum3 - 23.11.2010

Quote:
Originally Posted by ExeC
Посмотреть сообщение
pawn Код:
ShowPlayerDialog(playerid, GUNPACKAGES, DIALOG_STYLE_LIST,"Gun Packages"," PeeWee Package\nGangster package\nOG Package\n", "Enter", "Cancel");
Maybe you should remove the last
pawn Код:
\n
pawn Код:
ShowPlayerDialog(playerid, GUNPACKAGES, DIALOG_STYLE_LIST,"Gun Packages","PeeWee Package \nGangster package \nOG Package", "Enter", "Cancel");
Hope it works :S

EDIT:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == GUNPACKAGES)
    {
       if(response)
       {
        if(listitem == 0)
        {
            GivePlayerWeapon(playerid,1,900);
            GivePlayerWeapon(playerid,16,900);
            GivePlayerWeapon(playerid,22,900);
            GivePlayerWeapon(playerid,25,900);
            GivePlayerWeapon(playerid,29,900);
        }
        if(listitem == 1)
        {
            GivePlayerWeapon(playerid,9,900);
            GivePlayerWeapon(playerid,16,900);
            GivePlayerWeapon(playerid,24,900);
            GivePlayerWeapon(playerid,26,900);
            GivePlayerWeapon(playerid,28,900);
        }
        if(listitem == 2)
        {
            GivePlayerWeapon(playerid,5,900);
            GivePlayerWeapon(playerid,18,900);
            GivePlayerWeapon(playerid,24,900);
            GivePlayerWeapon(playerid,27,900);
            GivePlayerWeapon(playerid,31,900);
            GivePlayerWeapon(playerid,32,900);
        }
    }
   
    return 0;
}
pawn Код:
if(response)
{
Yea it works now thanks.


Re: What is wrong with this menu - ExeC - 23.11.2010

No problem.