else if(dialogid == DIALOG_LOGIN)
{
if(!response) return Kick(playerid);
else
{
new hpass[129];
WP_Hash(hpass, 129, inputtext);
if(!strcmp(hpass, PlayerInfo[playerid][pPass]))
{
mysql_format(mysql, query, sizeof(query), "SELECT * FROM `users` WHERE `Username` = '%e' LIMIT 1", Name[playerid]);
mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
TextDrawHideForPlayer(playerid,Login1[playerid]);
TextDrawHideForPlayer(playerid,Login2[playerid]);
TextDrawHideForPlayer(playerid,Login3[playerid]);
TextDrawHideForPlayer(playerid,Login4[playerid]);
TextDrawHideForPlayer(playerid,Login5[playerid]);
TextDrawHideForPlayer(playerid,Login6[playerid]);
TextDrawHideForPlayer(playerid,Login7[playerid]);
TogglePlayerSpectating(playerid, false);
PlayTimer[playerid] = SetTimerEx("PlayingTime", 60000, 1, "i", playerid);
StopAudioStreamForPlayer(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_MSGBOX,""COL_RED"KICKED",""COL_RED"You have been kicked for entering an incorrect password.","QUIT","");
KickPlayer(playerid);
}
return 1;
}
}
You might have forget to load player's password hash from the database before showing the login dialog.
|
The user's hash is probably produced with "raw password + salt". Doesn't look like you created the script.
|
Show us your server log. Maybe the Plugin isn't loading?
On the other hand, you should use https://sampwiki.blast.hk/wiki/SHA256_PassHash instead. Here is a Tutorial: https://sampforum.blast.hk/showthread.php?tid=581336 As you don't have to load an extra Plugin. |