16.05.2014, 03:46
Note: I'm using whirlpool.
Use whirlpool. It's more safer than udb_hash
pawn Код:
forward GetPassword(playerid, name[], value[]);
public GetPassword(playerid, name[], value[])
{
INI_String("Password", PlayerInfo[playerid][Password],129);
return 1;
}
pawn Код:
if( response )
{
INI_ParseFile(Path(playerid), "GetPassword", .bExtra = true, .extra = playerid);
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),inputtext);
if(!strcmp(hashpass, PlayerInfo[playerid][Password], true))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SetSpawnInfo(playerid,-1,1,2000.6132,1560.1454,15.3672,0.7534,0,0,0,0,0,0);
SpawnPlayer(playerid);
SetPlayerMoneyEx(playerid, PlayerInfo[playerid][Money]);
SetPlayerScoreEx(playerid, PlayerInfo[playerid][Score]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
return 1;
}
}