13.03.2012, 11:49
pawn Код:
dcmd_changepass(playerid, params[])
{
new name[MAX_PLAYER_NAME], buf[150], newpass[30];
GetPlayerName(playerid, name, sizeof(name));
if(sscanf(params,"s", newpass)) return SendClientMessage(playerid, 0xF60000AA, "USAGE: /changepass [new password]");
if(strlen(params) >= 3)
{
format(file, sizeof(file), "users/%s.txt", name);
newpass[playerid] = udb_hash(buf); // here is where I get the error
dini_Set(file, "Password", newpass);
SendClientMessage(playerid, COLOUR_GREEN, "Your password has been successfully been changed");
}
else
{
SendClientMessage(playerid, COLOUR_RED, "Your password must be atleast 3 characters long");
}
return 1;
}