Auto login
#1

PHP код:
    if(cache_num_rows() >= 1)
    {
        
cache_get_value_name(0"IP"IP[playerid], 16);
        new 
newIP[16];// query[300];
        
GetPlayerIp(playeridnewIP16);
        
IsPlayerRegistered[playerid] = 1;
        if(
strlen(IP[playerid]) != && !strcmp(IP[playerid], newIPtrue)) //Checks that the MySQL IP has a value and that they are the same.
        
{
            new 
query[150];
            
mysql_format(mysqlquerysizeof(query), "SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1"pName(playerid));
            
mysql_tquery(mysqlquery"OnAccountLoad""i"playerid);
        }
        else
        {
            new 
string[280];
            
cache_get_value_name(0"Password"pData[playerid][Password], 129);
            
//we will load player's password into pData[playerid][Password] to be used in logging in
            
cache_get_value_name_int(0"ID"pData[playerid][ID]); //now let's load player's ID into pData[playerid][ID] so we can use it later
            
format(string,sizeof(string),"Welcome back to ZoneX {FFFA00}%s\n{FFFFFF}\nYour UserID: %d | Your account is registered on our database\nPlease type your password to login",GetName(playerid),pData[playerid][ID]);
            
ShowPlayerDialog(playeriddLOGINDIALOG_STYLE_INPUT"Login"string"Login""Quit"); //And since we found a result from the database, which means, there is an account; we will show a login dialog
        
}
    } 
i use r41-2
the autologin is not working why?
Reply


Messages In This Thread
Auto login - by Loinal - 26.08.2017, 21:46
Re: Auto login - by Kane - 26.08.2017, 21:48
Re: Auto login - by Loinal - 26.08.2017, 22:04
Re: Auto login - by Vince - 26.08.2017, 22:42
Re: Auto login - by Ultraz - 26.08.2017, 22:47
Re: Auto login - by Loinal - 27.08.2017, 00:21
Re: Auto login - by Loinal - 27.08.2017, 00:24
Re: Auto login - by Logic_ - 30.08.2017, 18:54
Re: Auto login - by Loinal - 31.08.2017, 09:15
Re: Auto login - by Loinal - 31.08.2017, 09:18

Forum Jump:


Users browsing this thread: 1 Guest(s)