31.01.2011, 23:26
I believe you need a place for it to save, an accountpath
pawn Код:
if(sscanf(params, "ss", oldpass, newpass)) SendUsage(playerid, "USAGE: /changepass [old password] [new password]");
else
{
new accountpath[64]; format(accountpath, sizeof(accountpath), "%s", AccountPath(playerid));
new buf[129];
WP_Hash(buf, sizeof(buf), oldpass);
if(strcmp(dini_Get(accountpath, "password"), oldpass, true) == 0)
{
WP_Hash(buf, sizeof(buf), newpass);
dini_Set(accountpath, "password", newpass);
SendClientMessage(playerid, COLOR_GREEN, "SUCCESS: You have changed your password.");
}