Change password mysql
#1

This change pass cmd doesn't work:

Код:
CMD:changepass(playerid, params[])
{
	new pass[30];
    if (sscanf(params, "s[30]", pass))
	{
		return SendClientMessage(playerid, COLOR_THISTLE, "USAGE: /changepass [newpass]");
	}

	if (strlen(pass) < 4 || strlen(pass) > MAX_PLAYER_NAME)
	{
		return SendClientMessage(playerid, COLOR_TOMATO, "* Invalid password length, must be between 4-24 characters.");
	}

	new hash[128];
	SHA256_PassHash(pass, "aafGEsq13", hash, sizeof(hash));
	new handle = SQL::Open(SQL::READ, "players", "p_password", UserInfo[playerid][p_password]);
    SQL::ReadInt(handle, "p_password", UserInfo[playerid][p_password]);
                
	SHA256_PassHash(pass, "", UserInfo[playerid][p_password], 64);

	PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);

	SendClientMessage(playerid, COLOR_GREEN, "You have successfully changed your account password.");
	GameTextForPlayer(playerid, "~w~Password changed", 5000, 3);
	return 1;
}
Reply


Messages In This Thread
Change password mysql - by Face9000 - 05.01.2017, 20:24
Re: Change password mysql - by Vince - 05.01.2017, 20:39

Forum Jump:


Users browsing this thread: 2 Guest(s)