01.06.2014, 13:33
Edited richisme's code a bit, not even 1 line, added a few numbers and a symbol.
IGNORE ALL THE "*****", MY S3 FUCKED IT ALL.]
pawn Код:
public OnPlayerConnect(playerid)
{
* * //... check roleplay name, banned, blah blah
* *
* * // Check if valid user
* * new name[MAX_PLAYER_NAME+1];
* * GetPlayerName(playerid, name, sizeof(name))
* * mysql_format(mysql, query, sizeof(query), "SELECT * FROM `users` WHERE `Username` = '%s' LIMIT 1", name);
* * new Cache:result = mysql_query(mysql, query);
* * if(cache_num_rows() > 0)
* * {
* * * * // Get password from database and set it to pVariables[playerid][pPassword]
* * * * cache_get_field_content(0,"Password",129,pVariables[playerid][pPassword]);
* * * * // Show real password from database
* * * * SendClientMessageToAll(-1, pVariables[playerid][pPassword]);
* * * * // Show login dialog
* * * * ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login","Type your password below to login.","Login","Quit");
* * }
* * else
* * {
* * * * // Show Register dialog
* * }
* * cache_delete(result);
* *
* * return 1;
}
case DIALOG_LOGIN:
{
* * if ( !response ) return Kick ( playerid );
* * if( response )
* * {
* * * * new hpass[129];
* * * * WP_Hash(hpass, sizeof(hpass), inputtext);
* * * * // Show Input Password
* * * * SendClientMessageToAll(-1, hpass);
* * * * if(!strmatch(pVariables[playerid][pPassword], hpass))
* * * * {
* * * * * * ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
* * * * }
* * * * else
* * * * {
* * * * * * mysql_format(mysql, query, sizeof(query), "SELECT * FROM `users` WHERE `Username` = '%s' LIMIT 1", name1);
* * * * * * mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
* * * * }
* * * * /*
* * * * new string[256], string1[256];
* * * * format(string, sizeof(string), "Real pass: %s", pVariables[playerid][pPassword]);
* * * * SendClientMessageToAll(-1, string);
* * * * format(string1, sizeof(string1), "Input Pass: %s", hpass);
* * * * SendClientMessageToAll(-1, string1);
* * * * */
* * * * return 1;
* * }
}