SA-MP Forums Archive
Dialogs not working - 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: Dialogs not working (/showthread.php?tid=556360)



Dialogs not working - Markus1337 - 10.01.2015

I left the script working and got back to it now a year later and none of the dialogs are working?
I'm using the easydialog include.

Includes in the script:
pawn Код:
#include <a_samp>
#include <a_mysql>
#include <formatnumber>
#include <easydialog>
#include <sscanf2>
#include <streamer>
#include <zcmd>
OnPlayerSpawn:
pawn Код:
Dialog_Show(playerid, Show:SKILL, DIALOG_STYLE_LIST, "Select Skill", "Con Artist\nRapist\nHitman\nPrivate Medic\nArms Dealer\nKidnapper", "Cancel","Cancel");
Bottom of Script:
pawn Код:
Dialog:SKILL(playerid, response, listitem, inputtext[])
{
    if(response)
    {
        switch(listitem)
        {
            case 0:
                        {
                                SendClientMessage(playerid, -1,"Con artist");
                        }
            case 1:
            {
                SendClientMessage(playerid, -1,"Rapist");
            }
            case 2:
            {
                SendClientMessage(playerid, -1,"Hitman");
            }
            case 3:
                        {
                                SendClientMessage(playerid, -1,"Private Medic");
                        }
            case 4:
            {
                SendClientMessage(playerid, -1,"Arms Dealer");
            }
            case 5:
            {
                SendClientMessage(playerid, -1,"Kidnapper");
            }
        }
    }
    return 1;
}



Re: Dialogs not working - lwilson - 10.01.2015

do you have define?

__________________
Next Life Roleplay [Refunding/Hiring]
SERVER IP: 172.245.220.133:7108
http://nextlife-rp.boards.net/



Re: Dialogs not working - Markus1337 - 10.01.2015

https://sampforum.blast.hk/showthread.php?tid=475838

Does not need defines as I recall it.


Re: Dialogs not working - lwilson - 10.01.2015

there's define
Код:
#define DIALOG_WEAPON (1337)



Re: Dialogs not working - lwilson - 10.01.2015

show me DialogResponse and DialogPerformed


Re: Dialogs not working - Markus1337 - 10.01.2015

Do not reply if you don't even understand English at a basic level, what part of "This code turns into this code" do you not understand?

This code (without easydialog):
pawn Код:
#define DIALOG_WEAPON (1337)

CMD:weapons(playerid, params[])
{
    ShowPlayerDialog(playerid, DIALOG_WEAPON, DIALOG_STYLE_LIST, "Weapon Menu", "9mm\nSilenced 9mm\nDesert Eagle\nShotgun\nSawn-off Shotgun\nCombat Shotgun", "Select", "Cancel");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (dialogid == DIALOG_WEAPON)
    {
        if (response)
        {
            new str[64];
            format(str, 64, "You have selected the '%s'.", inputtext);

            GivePlayerWeapon(playerid, listitem + 22, 500);
            SendClientMessage(playerid, -1, str);
        }
    }
    return 1;
}
Looks like this, with easydialog include:
pawn Код:
CMD:weapons(playerid, params[])
{
    Dialog_Show(playerid, WeaponMenu, DIALOG_STYLE_LIST, "Weapon Menu", "9mm\nSilenced 9mm\nDesert Eagle\nShotgun\nSawn-off Shotgun\nCombat Shotgun", "Select", "Cancel");
    return 1;
}

Dialog:WeaponMenu(playerid, response, listitem, inputtext[])
{
    if (response)
    {
        new str[64];
        format(str, 64, "You have selected the '%s'.", inputtext);

        GivePlayerWeapon(playerid, listitem + 22, 500);
        SendClientMessage(playerid, -1, str);
    }
    return 1;
}
Quote:
Originally Posted by lwilson
Посмотреть сообщение
show me DialogResponse and DialogPerformed
Please stop replying as you seem to lack the knowledge required to assist me in this matter.