SA-MP Forums Archive
Problems with Dialog - 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: Problems with Dialog (/showthread.php?tid=447053)



Problems with Dialog - GwENiko - 28.06.2013

Im trying to setup this basic dialog with items list, but when i get in-game and try to spawn anything from the list, nothing happens, the guns are not given and messages are not sent. Here's the code:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
    switch(dialogid)
    {
        case 1:
        {
            switch(listitem)
            {
                case 0:
                {
                    GivePlayerWeapon(playerid, 24, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Desert Eagle with 9999 bullets.");
                }
                case 1:
                {
                    GivePlayerWeapon(playerid, 23, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Silenced 9mm with 9999 bullets.");
                }
                case 2:
                {
                    GivePlayerWeapon(playerid, 22, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a 9mm with 9999 bullets.");
                }
                case 3:
                {
                    GivePlayerWeapon(playerid, 32, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Tec-9 with 9999 bullets.");
                }
                case 4:
                {
                    GivePlayerWeapon(playerid, 28, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Micro-uzi with 9999 bullets.");
                }
                case 5:
                {
                    GivePlayerWeapon(playerid, 29, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a MP5 with 9999 bullets.");
                }
                case 6:
                {
                    GivePlayerWeapon(playerid, 25, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a pump shotgun with 9999 bullets.");
                }
                case 7:
                {
                    GivePlayerWeapon(playerid, 26, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a sawn-off shotgun with 9999 bullets.");
                }
                case 8:
                {
                    GivePlayerWeapon(playerid, 27, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Combat Shotgun with 9999 bullets.");
                }
                case 9:
                {
                    GivePlayerWeapon(playerid, 31, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a M4 rifle with 9999 bullets.");
                }
                case 10:
                {
                    GivePlayerWeapon(playerid, 30, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a AK-47 rifle with 9999 bullets.");
                }
                case 11:
                {
                    GivePlayerWeapon(playerid, 34, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Sniper rifle with 9999 bullets.");
                }
                case 12:
                {
                    GivePlayerWeapon(playerid, 33, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Country Rifle with 99999 bullets.");
                }
                case 13:
                {
                    SetPlayerArmour(playerid, 100.0);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a new body vest.");
                }
            }
        }
    }
}
return 1;
}
plz helpp


Re: Problems with Dialog - GwENiko - 28.06.2013

anyone knows? :S


Re: Problems with Dialog - CLT - 28.06.2013

Quote:
Originally Posted by GwENiko
Посмотреть сообщение
Im trying to setup this basic dialog with items list, but when i get in-game and try to spawn anything from the list, nothing happens, the guns are not given and messages are not sent. Here's the code:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
    switch(dialogid)
    {
        case 1:
        {
            switch(listitem)
            {
                case 0:
                {
                    GivePlayerWeapon(playerid, 24, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Desert Eagle with 9999 bullets.");
                }
                case 1:
                {
                    GivePlayerWeapon(playerid, 23, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Silenced 9mm with 9999 bullets.");
                }
                case 2:
                {
                    GivePlayerWeapon(playerid, 22, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a 9mm with 9999 bullets.");
                }
                case 3:
                {
                    GivePlayerWeapon(playerid, 32, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Tec-9 with 9999 bullets.");
                }
                case 4:
                {
                    GivePlayerWeapon(playerid, 28, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Micro-uzi with 9999 bullets.");
                }
                case 5:
                {
                    GivePlayerWeapon(playerid, 29, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a MP5 with 9999 bullets.");
                }
                case 6:
                {
                    GivePlayerWeapon(playerid, 25, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a pump shotgun with 9999 bullets.");
                }
                case 7:
                {
                    GivePlayerWeapon(playerid, 26, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a sawn-off shotgun with 9999 bullets.");
                }
                case 8:
                {
                    GivePlayerWeapon(playerid, 27, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Combat Shotgun with 9999 bullets.");
                }
                case 9:
                {
                    GivePlayerWeapon(playerid, 31, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a M4 rifle with 9999 bullets.");
                }
                case 10:
                {
                    GivePlayerWeapon(playerid, 30, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a AK-47 rifle with 9999 bullets.");
                }
                case 11:
                {
                    GivePlayerWeapon(playerid, 34, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Sniper rifle with 9999 bullets.");
                }
                case 12:
                {
                    GivePlayerWeapon(playerid, 33, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Country Rifle with 99999 bullets.");
                }
                case 13:
                {
                    SetPlayerArmour(playerid, 100.0);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a new body vest.");
                }
            }
        }
    }
}
return 1;
}
plz helpp
Any warnings at the compiling proccess?
And show me the CMD:...


Re: Problems with Dialog - GwENiko - 28.06.2013

No, no warns and no errors.

pawn Код:
CMD:equip(playerid, params[])
{
    ShowPlayerDialog(playerid, DIALOG_EQUIP, DIALOG_STYLE_LIST, "Equipment Menu", "Desert Eagle \n Silenced 9mm \n 9mm \n Tec-9 \n Micro-uzi \n MP5 \n Shotgun \n Sawn-off Shotgun \n Combat Shotgun \n M4 \n AK-47 \n Sniper \n County Rifle \n Armor", "Equip", "Close");
    return 1;
}



Re: Problems with Dialog - DobbysGamertag - 28.06.2013

Try it like this:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_EQUIP)
    {
        if(!response)return 0;
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    GivePlayerWeapon(playerid, 24, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Desert Eagle with 9999 bullets.");
                }
                case 1:
                {
                    GivePlayerWeapon(playerid, 23, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Silenced 9mm with 9999 bullets.");
                }
                case 2:
                {
                    GivePlayerWeapon(playerid, 22, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a 9mm with 9999 bullets.");
                }
                case 3:
                {
                    GivePlayerWeapon(playerid, 32, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Tec-9 with 9999 bullets.");
                }
                case 4:
                {
                    GivePlayerWeapon(playerid, 28, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Micro-uzi with 9999 bullets.");
                }
                case 5:
                {
                    GivePlayerWeapon(playerid, 29, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a MP5 with 9999 bullets.");
                }
                case 6:
                {
                    GivePlayerWeapon(playerid, 25, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a pump shotgun with 9999 bullets.");
                }
                case 7:
                {
                    GivePlayerWeapon(playerid, 26, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a sawn-off shotgun with 9999 bullets.");
                }
                case 8:
                {
                    GivePlayerWeapon(playerid, 27, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Combat Shotgun with 9999 bullets.");
                }
                case 9:
                {
                    GivePlayerWeapon(playerid, 31, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a M4 rifle with 9999 bullets.");
                }
                case 10:
                {
                    GivePlayerWeapon(playerid, 30, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a AK-47 rifle with 9999 bullets.");
                }
                case 11:
                {
                    GivePlayerWeapon(playerid, 34, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Sniper rifle with 9999 bullets.");
                }
                case 12:
                {
                    GivePlayerWeapon(playerid, 33, 9999);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a Country Rifle with 99999 bullets.");
                }
                case 13:
                {
                    SetPlayerArmour(playerid, 100.0);
                    SendClientMessage(playerid, 0xFF9900AA, "You have equipped a new body vest.");
                }
            }
        }
    }
}
return 1;
}



Re: Problems with Dialog - GwENiko - 28.06.2013

Fixed, thank ya