22.04.2018, 13:10
(
Последний раз редактировалось FaLLenGirL; 23.04.2018 в 10:38.
)
Hello there, someone from my server told me that the Auto Login it doesn't work anymore.
I left this feature in good shape. Everything worked when i tested or when i made it.
Now, i haven't checked anymore this Auto Login because there was no problem with it untill now.
I haven't worked at this feature or changed something that contains auto login. I will show you my code and please tell me your opinion about it:
I left this feature in good shape. Everything worked when i tested or when i made it.
Now, i haven't checked anymore this Auto Login because there was no problem with it untill now.
I haven't worked at this feature or changed something that contains auto login. I will show you my code and please tell me your opinion about it:
PHP код:
-> This code is on "public OnPlayerRequestClass( playerid, classid )"
because i want that the dialog to appear here.
if( PlayerInfo[ playerid ][ p_first_login ] == 0 )
{
new query[ 2000 ];
format( query, sizeof( query ), "SELECT * FROM `Accounts` WHERE `Name` = '%s'", PlayerName( playerid ) );
mysql_pquery( database, query, "OnAccountCheck", "d", playerid );
PlayerInfo[ playerid ][ p_first_login ] = 1;
}
PHP код:
function OnAccountCheck( playerid )
{
eString[ 0 ] = EOS;
gAccountCheck[ playerid ] = true;
new Rows, pField[ 20 ];
cache_get_row_count( Rows );
if( Rows )
{
cache_get_value_name( 0, "IP", pField, 20 );
cache_get_value_int( 0, "AutoLogin", PlayerInfo[ playerid ][ p_auto_login ] );
if( !strcmp( GetPlayerIPEx( playerid ), pField, true ) && PlayerInfo[ playerid ][ p_auto_login ] == 1 )
{
new query[ 2000 ];
format( query, sizeof( query ), "SELECT * FROM `Accounts` WHERE `Name` = '%s'", PlayerName( playerid ) );
mysql_pquery( database, query, "OnLoginDone", "d", playerid );
}
else
{
// Login Dialog
}
}
else
{
// Register Dialog
}
return 1;
}