OnDialogResponse
#1

pawn Код:
if(dialogid == DIALOG_NWEAPONS)
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, 9 , 1);
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid, 22, 3000);
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid, 23, 3000);
            }
            if(listitem == 3)
            {
                GivePlayerWeapon(playerid, 24 , 3000);
            }
            if(listitem == 4)
            {
                GivePlayerWeapon(playerid, 25 , 3000);
            }
            if(listitem == 5)
            {
                GivePlayerWeapon(playerid, 26 , 3000);
            }
            if(listitem == 6)
            {
                GivePlayerWeapon(playerid, 27 , 3000);
            }
            if(listitem == 7)
            {
                GivePlayerWeapon(playerid, 28,  3000);
            }
            if(listitem == 8)
            {
                GivePlayerWeapon(playerid, 29 , 3000);
            }
            if(listitem == 9)
            {
                GivePlayerWeapon(playerid, 30,  3000);
            }
            if(listitem == 10)
            {
                GivePlayerWeapon(playerid, 31,  3000);
            }
            if(listitem == 11)
            {
                GivePlayerWeapon(playerid, 32 ,  3000);
            }
            if(listitem == 12)
            {
                GivePlayerWeapon(playerid, 33 , 3000);
            }
            if(listitem == 13)
            {
                GivePlayerWeapon(playerid, 34 , 3000);
            }
        }
    }
When i try to give the first opinion (chainsaw) it gives me a golf club instead, and if i try to pick #2 it gives me a nightstick, if i try the other numbers it doesn't give me..
Reply
#2

Show us the ShowPlayerDialog.
Reply
#3

Could you show us your ShowPlayerDialog?

and your whole code for OnDialogResponse.
Reply
#4

Bump
Reply
#5

Mmh, can you show me your command or function where you put ShowPlayerDialog like the others said?
Also put it like this:
pawn Код:
if(dialogid == DIALOG_NWEAPONS)
{
    if(response)
    {
        switch(listitem)
        {
            case 0: GivePlayerWeapon(playerid, 9 , 1);
            case 1: GivePlayerWeapon....
            //and so on...
        }
   }
}
Reply
#6

Show us where you use the dialog.

It should be something like:
pawn Код:
ShowPlayerDialog(playerid, DIALOG_NWEAPONS, DIALOG_STYLE_LISTITEM, "Weapons", "Brass Knuckles\nNightstick..(and then the rest)", "Select", "Cancel");
Reply
#7

EDIT: Thanks.....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)