24.10.2013, 23:42
That's exactly what I wanted to know, lol.
Try:
I highly suggest you to use another hashing system though, like Whirlpool.
Quote:
Register system is: https://sampforum.blast.hk/showthread.php?tid=273088
all default, i didn't change anything of it. |
pawn Код:
CMD:changepass(playerid,params[])
{
new string[128],
oldpass[32],
newpass[32];
if(sscanf(params, "s[32]s[32]", oldpass, newpass)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFF00}[Usage:]: {FFFFFF}/changepass [old password] [new password]");
if(!strcmp(udb_hash(oldpass), udb_hash(newpass)))
{
if(!strcmp(PlayerInfo[playerid][pPass], udb_hash(newpass))) return SendClientMessage(playerid,COLOR_RED,"Error: Your new password is the current password.");
format(PlayerInfo[playerid][pPass], 32, newpass);
format(string, sizeof(string), "Your password is successfully changed to: %s", newpass);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else
{
SendClientMessage(playerid,COLOR_RED,"Error: Your old password is incorrect, please try again.");
}
return 1;
}