case DIALOG_LOGIN: ShowPlayerDialog( playerid, DIALOG_LOGIN2, DIALOG_STYLE_INPUT, "Password","Please write your current password.","Login", "Kick"),
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
case DIALOG_LOGIN2:
{
if (!response) return Kick(playerid);
if (response)
{
if (strlen(inputtext) == 0)
return ShowPlayerDialog(playerid, DIALOG_LOGIN2, DIALOG_STYLE_INPUT, "Password","Error!\n{FFFFFF}Please write your current password.","Login", "Kick");
new PlayerFile[13 + MAX_PLAYER_NAME], Password[20 + 1];
format( PlayerFile , sizeof PlayerFile, UserData, Encode( pName( playerid ) ) );
INI_ParseFile( PlayerFile, "ParsePlayerPass", false, true, playerid );
GetPVarString( playerid, "pPass", Password, sizeof Password );
new buf[145];
WP_Hash(buf, sizeof(buf), Password);
if(strcmp(Password, buf, false) == 0)
{
SetPVarInt( playerid, "Logged", 1 );
format( PlayerFile , sizeof PlayerFile, UserData, Encode( pName( playerid ) ) );
INI_ParseFile( PlayerFile, "LoadUser", false, true, playerid, true, false );
SendClientMessage(playerid, -1, ""COL_RED"ACCOUNT: "COL_BLUE"You are now "COL_ORANGE"Registered"COL_BLUE", and have been "COL_ORANGE"Automaticaly "COL_BLUE"logged in");
}
else ShowPlayerDialog(playerid, DIALOG_LOGIN2, DIALOG_STYLE_INPUT, "Wrong password...", "Wrong password!\n{FFFFFF}Please try again.", "Login", "Kick");
}
}
if(strcmp(Password, buf, false) == 0)
if(strcmp(Password, buf) == true)
if(!strcmp(Password,buf,false))
new Password[129];
new Password[20 + 1];
WP_Hash(buf, sizeof(buf), inputtext);
if(strcmp(Password, inputtext) == true)
case DIALOG_LOGIN: ShowPlayerDialog( playerid, DIALOG_LOGIN2, DIALOG_STYLE_INPUT, "Password","Please write your current password.","Login", "Kick"),
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
case DIALOG_LOGIN2:
{
if (!response) return Kick(playerid);
if (response)
{
if (strlen(inputtext) == 0)
return ShowPlayerDialog(playerid, DIALOG_LOGIN2, DIALOG_STYLE_INPUT, "Password","Error!\n{FFFFFF}Please write your current password.","Login", "Kick");
new PlayerFile[13 + MAX_PLAYER_NAME], Password[129];
format( PlayerFile , sizeof PlayerFile, UserData, Encode( pName( playerid ) ) );
INI_ParseFile( PlayerFile, "ParsePlayerPass", false, true, playerid );
GetPVarString( playerid, "pPass", Password, sizeof Password );
new buf[145];
WP_Hash(buf, sizeof(buf), inputtext);
if(strcmp(Password, inputtext) == true)
{
SetPVarInt( playerid, "Logged", 1 );
format( PlayerFile , sizeof PlayerFile, UserData, Encode( pName( playerid ) ) );
INI_ParseFile( PlayerFile, "LoadUser", false, true, playerid, true, false );
SendClientMessage(playerid, -1, ""COL_RED"ACCOUNT: "COL_BLUE"You are now "COL_ORANGE"Registered"COL_BLUE", and have been "COL_ORANGE"Automaticaly "COL_BLUE"logged in");
}
else ShowPlayerDialog(playerid, DIALOG_LOGIN2, DIALOG_STYLE_INPUT, "Wrong password...", "Wrong password!\n{FFFFFF}Please try again.", "Login", "Kick");
}
}
pawn Код:
|
new buf[145];
WP_Hash(buf, sizeof(buf), Password);
new buf[145];
WP_Hash(buf, sizeof(buf), inputtext);