SA-MP Forums Archive
Login - 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: Login (/showthread.php?tid=600438)



Login - K0P - 08.02.2016

Ive tried to fix it but i am unable to.
It does not show the login dialog if the player is registered,it always shows the register dialog



Код:
    new query[250],rows,fields,str1[250];
    mysql_format(mysql, query, sizeof(query), "SELECT `Password`, `Account_ID` FROM `players` WHERE `Name` = '%s' LIMIT 1", GetName(playerid));
    mysql_tquery(mysql, query);

    cache_get_data(rows, fields, mysql);
    if(rows)
    {
        cache_get_field_content(0, "Password", PlayerInfo[playerid][pPass], mysql, 30);
        PlayerInfo[playerid][Accountid] = cache_get_field_content_int(0, "Account_ID");
    	format(str1, 150, "{FFFFFF}This name is registered,enter a password for this account:\n");
       	ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""COL_GREEN"UGF - Login", str1, "Login", "");
    }
    else
    {
        format(str1, 150, "\n{FFFFFF}Welcome To FreeRoam Server\n\n{00FF00}Account Name:{FFFFFF} %s\n\nEnter A Password To Register This Account", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", str1, "Register", "");
        PlayerInfo[playerid][New] = 1;
    }



Re: Login - Richie© - 08.02.2016

Hi bro, looks like you're treating mysql_tquery as non threaded. You should use mysql_query or put pass the threaded query to a callback.


Re: Login - K0P - 08.02.2016

Quote:
Originally Posted by Richie©
Посмотреть сообщение
Hi bro, looks like you're treating mysql_tquery as non threaded. You should use mysql_query or put pass the threaded query to a callback.
Oh,thanks,its worked
I thought i can use mysql_tquery like that