SA-MP Forums Archive
Changepass command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Changepass command (/showthread.php?tid=553154)



Changepass command - Sensation - 28.12.2014

Hi guys! Im using SFCRRPG gamemode. I would like change /changepass command. I would like command is /changepass oldpass newpass but this command only /changepass newpass

This is changepass command
Код:
dcmd_changepass(playerid,params[])
{
	#pragma unused params
	
	ShowChangePassScreen(playerid);
	SendClientMessage(playerid,COLOR_LIGHTBLUE,"Enter your desired password into the box below and click ok.");
	return 1;
}

This is DIALOG_CHANGEPASS

Код:
     if(dialogid == DIALOG_CHANGEPASS)
    {
        if (response == 0)
	    {
			return 1;
	    }
	    if (response == 1)
	    {
            if (strlen(inputtext)==0)
			{
		        SendClientMessage(playerid,COLOR_ERROR,"Please enter your desired password in the box.");
                ShowChangePassScreen(playerid);
				return 1;
			}
            udb_UserSetInt(PlayerName(playerid),"password_hash",udb_hash(inputtext));
            format(string,sizeof(string),"You have successfully changed your password to '%s', use this to login from now on.",inputtext);
			SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            return true;
	    }
	    return 1;
    }

And this is stock ShowChangePassScreen

Код:
stock ShowChangePassScreen(playerid)
{
    new string[128];
    format(string, sizeof(string), "Please make sure you enter your new password correctly.\nEnter your desired password below then click ok.",PlayerName(playerid));
    ShowPlayerDialog(playerid,DIALOG_CHANGEPASS,DIALOG_STYLE_INPUT,"Enter the new password.",string,"Change","Cancel");
}

I would like /changepass oldpass newpass

Please help me

Sorry for my bad english.


Re: Changepass command - UltraScripter - 28.12.2014

on change pass you can put your register dialog!