Question about /changepass command (using whirpool)
#1

If i use Whirlpool plugin, i cant change password if someone lost it manual over .ini file.

Is there any way to change password with admin command to change it in game of some player and how would i do something like that? How would i change someone password if somebudy lose it, but cant access it through .ini file. Is it even possible?
Reply
#2

Код:
CMD:setpassword(playerid, params[])
{
	if (!IsPlayerAdmin(playerid))
	    return SendClientMessage(playerid, 0xFF0000FF, "You cannot use this command.");

	new pname[34], pass[33];
	// pName size depends on your saving folder name
	// As an example, I'll be using
	// Users/.ini
	// Pass size depends on your max pass length
	if (sscanf(params, "s[24]s[33]", pname, pass))
	    return SendClientMessage(playerid, 0x00FFFFFF, "Usage: /setpassword [player name] [new password]");
	if (strlen(pass) > 32)
	    return SendClientMessage(playerid, 0xFF0000FF, "Max length of the password is 32 characters.");
	format(pname, sizeof (pname), "Users/%s.ini", pname);
	if (fexist(pname))
	{
	    new buf[129];
	    WP_Hash(buf, sizeof (buf), pass);
	    new INI: File = INI_Open(pname);
	    INI_WriteString(File, "Password", buf);
	    INI_Close(File);
	    SendClientMessage(playerid, 0x00FF00FF, "Password has been changed.");
	}
	else SendClientMessage(playerid, 0xFF0000FF, "Name doesn't exist.");
	return 1;
}
This uses Y_INI. Change what you have to change depending on what you use.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)