SA-MP Forums Archive
MySQL logging-in problem - 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: MySQL logging-in problem (/showthread.php?tid=522396)



MySQL logging-in problem - PawelQ - 27.06.2014

Hey, i have problem with logging-in using MyBB database
When i insert password dialog is dissapearing and nothing happening

there's code

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case D_INFO:
        {
            return 1;
        }
        case D_LOGIN_GLOBAL:
        {
            if(response)
            {
                new str[256];

                mysql_real_escape_string(inputtext, inputtext);
                format(str, sizeof(str), "SELECT c.player_uid FROM `mybb_users` m, `fc_characters` c WHERE m.`password` = MD5(CONCAT(MD5(m.salt),'', MD5('%s'))) AND m.`uid` = c.`global_uid` AND c.`username` = '%s' LIMIT 1", inputtext, PlayerName(playerid));
                mysql_check(); mysql_query(str);
                mysql_store_result();

                if(mysql_num_rows())
                {
                    OnPlayerLogin(playerid, mysql_fetch_int());
                    
                    mysql_free_result();
                }
                else
                {
                    new string[256];
                    format(string, sizeof(string), "{FFFFFF}blablabla {88CC54}"DEF_NAME"{FFFFFF}.\n{FFFFFF}blablabla.");
    				format(string, sizeof(string), "%s\n\n{FFFFFF}blablabla.", string);

                    ShowPlayerDialog(playerid, D_LOGIN_GLOBAL, DIALOG_STYLE_PASSWORD, " Logging-in dialog", string, "Log-in", "Cancel");
                    
                    mysql_free_result();
                }
            }
            else
            {
                KickWithWait(playerid);
                return 1;
            }
        }



Re: MySQL logging-in problem - Noliax8 - 27.06.2014

Hi,

Do you have a file log with errors? Else, sends here

Nlx.