OfflineChangeUserPassword
#1

i can't figure it out.. how to put password in the array PlayerInfo[playerid][pPassword]..

Код:
CMD:changeuserpassword(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 2014)
	{
		new string[128], playername[MAX_PLAYER_NAME], password[32], hashpass[129];
		if(sscanf(params, "s[24]s[24]", playername, password)) return SendInfoMessage(playerid, 3, "0", "/changeuserpassword [Firstname_Surname] [Password]");
		if(INI_Exist(playername))
		{
 			WP_Hash(hashpass,sizeof(hashpass),password);
			new PlayerFile[MAX_PLAYER_NAME + 32];
			format( PlayerFile , sizeof PlayerFile, ACCOUNT_DATA, playername);
			new INI:File = INI_Open(PlayerFile);
			INI_WriteString(File,"Password",hashpass);
			format(PlayerInfo[unknown][pPassword],129,hashpass);
			INI_Close(File);
			format(string, sizeof(string), "You have changed %s's password {00FF6E}their new password is: %s", playername, password);
			SendInfoMessage(playerid, 2, "0", string);
		}
		else
		{
		    SendInfoMessage(playerid,0,"0","This account doesn't exist");
		    return 1;
		}
		return 1;
	}
	else return SendInfoMessage(playerid, 0, "75", "You're not authorized to use this command.");
}
Reply


Messages In This Thread
OfflineChangeUserPassword - by Antoniohl - 07.05.2015, 17:01
Re: OfflineChangeUserPassword - by sammp - 07.05.2015, 17:02
Re: OfflineChangeUserPassword - by Antoniohl - 07.05.2015, 17:03
Re: OfflineChangeUserPassword - by Konstantinos - 07.05.2015, 17:04
Re: OfflineChangeUserPassword - by Antoniohl - 07.05.2015, 17:08
Re: OfflineChangeUserPassword - by Konstantinos - 07.05.2015, 17:20
Re: OfflineChangeUserPassword - by Antoniohl - 07.05.2015, 17:22
Re: OfflineChangeUserPassword - by sammp - 07.05.2015, 18:27

Forum Jump:


Users browsing this thread: 5 Guest(s)