Login problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Login problem (
/showthread.php?tid=513647)
Login problem -
Dziugsas - 17.05.2014
Hello guys.
Where is the prob. in the code , cause i can type anything and it's still logs me in.
Код:
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
new HashPass[129];
WP_Hash(HashPass, sizeof(HashPass), inputtext);
if(strcmp(HashPass, PlayerInfo[playerid][pPass]) == 0)
{
INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"{ff0000}Success!","{00ff66} You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{ff0000}Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
}
return 1;
}
}
Re: Login problem -
Rittik - 17.05.2014
Код:
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
new HashPass[128];
WP_Hash(HashPass, sizeof(HashPass), inputtext);
if(strcmp(WP_Hash, PlayerInfo[playerid][pPass]) == 0)// this line edited
{
INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"{ff0000}Success!","{00ff66} You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{ff0000}Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
}
return 1;
}
}
Best login/register tutorial
https://sampforum.blast.hk/showthread.php?tid=273088