Changepass command help
#1

I changed my hashing method from udb_hash to whirlpool but now it giving me many errors in game

Код:
CMD:changepass (playerid, params[])
{
	new oldpass[128], newpass[128], name[MAX_PLAYER_NAME];
	if(sscanf(params, "s[20]s[20]", oldpass, newpass)) return SendClientMessage(playerid, COLOR_USAGE, "* USAGE:/changepass [oldpassword] [newpassword]");
	new buf1[129], buf[129];
	WP_Hash(buf, sizeof(buf), oldpass);
	if(strcmp(buf, USERINFO[playerid][pPass], false) == 1) return SendClientMessage(playerid, COLOR_ERROR, "Incorrect password");
	if(strlen(newpass) < 5 ) return SendClientMessage(playerid, COLOR_ERROR, "Your new password must include atleast 5 characters");
	if(strlen(newpass) > 20 ) return SendClientMessage(playerid, COLOR_ERROR, "Your new password cannot go over 20 characters");
	WP_Hash(buf1, sizeof(buf1), newpass);
	USERINFO[playerid][pPass] = buf1;
	SendClientMessage(playerid, COLOR_SUCCESSFUL, "Your password has been changed successfully");
	new str[128];
	format(str, sizeof(str), "Your new password: %s", newpass);
	SendClientMessage(playerid, -1, str);
	return 1;
}
even I put a wrong pass as my old pass there, it accepts that as the correct pass
plz tell me what is wrong there
Reply
#2

Might be work, you checked if "pPass" has been changed on the script?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)