SA-MP Forums Archive
[HELP] 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: [HELP] Dialog (/showthread.php?tid=542598)



[HELP] Dialog - ShoortyFl - 20.10.2014

Can someone please tell me what is wrong with this, i type /leader, and the dialog shows up, but after i choose offline kick it shows me login dialog, not the DIALOG_LEADER:


pawn Код:
CMD:leader(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SCM(playerid, GREY, "Error.");
    if(PI[playerid][Leader] == 0) return SCM(playerid, GREY, "Error.");

    SPD(playerid, DIALOG_LEADER, DIALOG_STYLE_LIST, "Leader Management", "Offline Kick\nAll Members", "Choose", "Exit");
    return 1;
}

// Dialogs
        case DIALOG_LEADER:
        {
            if(response)
            {
                switch(listitem)
                {
                    case 0:
                    {
                        new str[250];
                        format(str, sizeof(str), "Enter a user name that you wish to kick..");
                        SPD(playerid, DIALOG_STYLE_INPUT, DIALOG_LOFFKICK, "Offline Kick", str, "Kick", "Exit");
                    }
                    case 1:
                    {
                        // Posle mozda veceras
                    }
                }
            }
        }
        case DIALOG_LOFFKICK:
        {
            if(!response) return 1;
            if(response)
            {
                new query[200];
                if(strlen(inputtext) < 4 || strlen(inputtext) > 25)
                {
                    new str[250];
                    SCM(playerid, GREY, "To long or to short..");
                    format(str, sizeof(str), "Enter a user name that you wish to kick..");
                    return SPD(playerid, DIALOG_STYLE_INPUT, DIALOG_LOFFKICK, "Offline Kick", str, "Kick", "Exit");
                }
                format(query, sizeof(query), "SELECT * FROM `Igraci` WHERE `Ime` = '%s'", inputtext);
                mysql_function_query(konekt, query, true, "OfflineUninvite", "iis", THREAD_UNINVITE, playerid, inputtext);
            }
        }



Re: [HELP] Dialog - Finn - 20.10.2014

Your DIALOG_LEADER is probably the same as DIALOG_LOGIN


Re: [HELP] Dialog - ShoortyFl - 20.10.2014

#define DIALOG_LOGIN 1
#define DIALOG_REG 2
#define DIALOG_GOD 3
#define DIALOG_SPOL 4
#define DIALOG_EMAIL 5
#define DIALOG_PDTIKET 6
#define DIALOG_CHANGEPASS 7
#define DIALOG_RENTCAR 8
#define DIALOG_RENTCARDIALOG 9
#define DIALOG_LECENJE 10
#define DIALOG_MARKETBUY 11
#define DIALOG_ADMINS 12
#define DIALOG_LEADER 13
#define DIALOG_LOFFKICK 14
#define DIALOG_ALLMEMBERS 15


Re: [HELP] Dialog - Finn - 20.10.2014

Sorry you didn't have the code in your post when I replied.

Here's the problem:
Код:
SPD(playerid, DIALOG_STYLE_INPUT, DIALOG_LOFFKICK, "Offline Kick", str, "Kick", "Exit");
Those should be the other way around, like here?
Код:
SPD(playerid, DIALOG_LEADER, DIALOG_STYLE_LIST, "Leader Management", "Offline Kick\nAll Members", "Choose", "Exit");



Re: [HELP] Dialog - ShoortyFl - 20.10.2014

Whoa thanks, what was i thinking...