What's wrong?
#1

This is my first time making a dialog, so i'm curious what i've already fucked up
Код:
        if(dialogid == 2)
        {
            if(response)
            {
            if(listitem == 0)
            {
            GivePlayerWeapon(playerid, 31, 500);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Broń Poboczna", "Glock z tłumikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            if(listitem == 1)
            {
            GivePlayerWeapon(playerid, 29, 500);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Broń Poboczna", "Glock z tłumikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            if(listitem == 2)
            {
            GivePlayerWeapon(playerid, 28, 500);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Broń Poboczna", "Glock z tłumikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            if(listitem == 3)
            {
            GivePlayerWeapon(playerid, 34, 20);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Broń Poboczna", "Glock z tłumikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            if(listitem == 4)
            {
            GivePlayerWeapon(playerid, 27, 500);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Broń Poboczna", "Glock z tłumikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            if(listitem == 5)
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Broń Poboczna", "Glock z tłumikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            return 1;
            }
		}
I know something's wrong, because when i compile i'm getin' 26 errors
Reply
#2

Try this
pawn Код:
if(dialogid == 2)
{
    if(response)
    {
        switch(listitem)
        {
            case 0:
            {
            GivePlayerWeapon(playerid, 31, 500);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Bron' Poboczna", "Glock z t?umikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            case 1:
            {
            GivePlayerWeapon(playerid, 29, 500);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Bron' Poboczna", "Glock z t?umikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            case 2:
            {
            GivePlayerWeapon(playerid, 28, 500);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Bron' Poboczna", "Glock z t?umikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            case 3:
            {
            GivePlayerWeapon(playerid, 34, 20);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Bron' Poboczna", "Glock z t?umikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            case 4:
            {
            GivePlayerWeapon(playerid, 27, 500);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Bron' Poboczna", "Glock z t?umikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            case 5:
            {
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Bron' Poboczna", "Glock z t?umikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
        }
    }
    else return SendClientMessage(playerid,0xff0000FF,"cancelled");//in ur language ;)
}
Edit little mistake fixed
Reply
#3

[QUOTE=iggy1;798158]Try this
pawn Код:
if(dialogid == 2)
{
    if(response)
    {
        switch(listitem)
        {
            case 0:
            {
            GivePlayerWeapon(playerid, 31, 500);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Bron' Poboczna", "Glock z t?umikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            case 1:
            {
            GivePlayerWeapon(playerid, 29, 500);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Bron' Poboczna", "Glock z t?umikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            case 2:
            {
            GivePlayerWeapon(playerid, 28, 500);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Bron' Poboczna", "Glock z t?umikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            case 3:
            {
            GivePlayerWeapon(playerid, 34, 20);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Bron' Poboczna", "Glock z t?umikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            case 4:
            {
            GivePlayerWeapon(playerid, 27, 500);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Bron' Poboczna", "Glock z t?umikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
            case 5:
        {
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Bron' Poboczna", "Glock z t?umikiem \n Desert Eagle \n Brak", "Wybierz", "Anuluj");
            }
        }
    }
}
[/QUOUmm, I'm so stupid!!!!! Look at
Код:
if(listitem == 5)
it should be
Код:
if(listitem == 5)
{
Reply
#4

Your version is also wrong because listitems start from '0' so your first listitem will be ignored better using switch also.

Edit: lol my mistake u did do if(listitem == 0) (unless u edited)
Reply
#5

with switches still errors
Reply
#6

Show errors and OnPlayerDialogResponse callback might be able to help with that info.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)