09.01.2017, 14:32
"if( sscanf( inputtext, "s[25]", lPassword ) )"
This is in your DIALOG_LOGIN dialog.
Well, this just stores the string inputtext to lPassword which means that there is no comparison at all if the password is correct.
You rather need a function to compare strings, namely strcmp (=string compare). It will return 0 if the two given strings are the same.
So you will need this:
Also not the else statements which I added.
This is in your DIALOG_LOGIN dialog.
Well, this just stores the string inputtext to lPassword which means that there is no comparison at all if the password is correct.
You rather need a function to compare strings, namely strcmp (=string compare). It will return 0 if the two given strings are the same.
So you will need this:
PHP код:
if(strcmp(inputtext,lPassword)){
//stuff here if the password is wrong
}
else if( strlen( inputtext ) < 3 || strlen( inputtext ) > 24 )
return ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FFFFFF}Login: {FF0000}characters error{FFFFFF}:", "{FFFFFF}Please enter in the box bellow your password.\n{FFFFFF}This password must have at least: {FF0000}6 {FFFFFF}characters:", "Login", "New Name");
else if( strfind( inputtext, "'", true ) != -1 )
return ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FFFFFF}Login: {FF0000}invalid characters{FFFFFF}:", "{FFFFFF}Please enter in the box bellow your password.\n{FF0000}ATTENTION: {FFFFFF}You can't use this (') in your password:", "Login", "New Name" );
else
{
mysql_real_escape_string( inputtext, lPassword, DB_Connect );
mysql_format( DB_Connect, Query, sizeof( Query ), "SELECT * FROM `Accounts` WHERE `Name` = '%s' AND `Password` = '%s'", PlayerName( playerid ), lPassword );
mysql_tquery( DB_Connect, Query, "LoadPlayerData", "is", playerid, PlayerName( playerid ) );
}