13.03.2012, 12:11
Ok try this.
PHP код:
dcmd_changepass(playerid, params[])
{
new name[MAX_PLAYER_NAME], 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);
dini_Set(file, "Password", udb_hash(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;
}