21.04.2013, 09:28
I have an Account System based on BlueG's MySQL R8 system. I have done everything in phpMyAdmin, i have WAMP and all those stuff.
Everytime i connect, it shows up only the register dialog, that means i don't have any account, even after i type my password and i reconnect.
Here is the dialog function:
Here is the function wich loads the player data:
Can any of you help me to fix it ?
#Sorry for my bad english
Everytime i connect, it shows up only the register dialog, that means i don't have any account, even after i type my password and i reconnect.
Here is the dialog function:
Код:
MySQL_Account( playerid , acc[ ] )
{
new
rows,
fields,
string[ 256 ]
;
cache_get_data( rows , fields );
if( !rows )
{
format( string , sizeof( string ) , "{FFFFFF}Welcome, {0537FF}%s {FFFFFF}!\n{FFFFFF}You need to register before playing !" , acc );
SPD( playerid , Register , PASS , "{FFFFFF}Register" , string , "Register" , "Kick" );
}
else if( rows )
{
format( string , sizeof( string ) , "{FFFFFF}Welcome back, {0537FF}%s {FFFFFF}!\n{FFFFFF}You need to login before playing." , acc );
SPD( playerid , Login, PASS, "{FFFFFF}Login" , string , "Login" , "Cancel" );
}
return 1;
}
Код:
MySQL_Load_Data( playerid , acc[ ] )
{
new
rows,
fields,
str[ 256 ]
;
cache_get_data( rows , fields );
if( rows )
{
cache_get_row( 0 , 0 , str );
P_DATA[ playerid ][ SQL_ID ] = strval( str );
cache_get_row( 0 , 3 , str );
P_DATA[ playerid ][ Admin ] = strval( str );
}
else
{
P_DATA[ playerid ][ FailedLogins ] ++ ;
format( str, sizeof( str ),"{FFFFFF}Hey, {0537FF}%s {FFFFFF}!\n{FFFFFF}You have entered the wrong passowrd !\n{FFFFFF}Please, retype your password below but careful because you have just {0537FF}%i {FFFFFF}chanches left !",GetName( playerid ) , 3 - P_DATA[ playerid ][ FailedLogins ] );
SPD( playerid, Login, PASS, "Login", str, "Login", "Exit");
if( P_DATA[ playerid ][ FailedLogins ] == 3 )
{
format(str,sizeof( str ),"%s {FFFFFF}has been kicked ! [ Reason: {FF0000}Wrong Password {FFFFFF}]", GetName( playerid ) );
SendClientMessageToAll( C_B, str );
new Text[ 30 ];
format( Text, sizeof( Text ), "{FFFFFF}You have been kicked because you tiped wrong your password for 3 times !" );
SPD( playerid, PassKick, PASS, "{FF0000}KICKED !", Text, "Ok", "" );
Kick( playerid );
}
}
#Sorry for my bad english


