Change Password Help
#1

Hi, for somereason this change password command, which requires them to type their old pass and a new one doesn't work.

It says that you have typed a wrong old password and when I make it so you don't need the old password, it saves your password as nothing.

Here it is:
pawn Код:
//COMMAND: ChangePass
    if(strcmp(cmd,"/ChangePass",true)==0)
    {
      if(PINFO[playerid][Logged]==0)return SendClientMessage(playerid,ORANGE,"**(E)** This is a member command! (/Register) and get many other commands too!");
      new newpass[128];
      new oldpass[128];
      tmp=strtok(cmdtext,idx);
      if(strlen(tmp)==0)return SendClientMessage(playerid,GREY,"**(E)** You haven't typed all of the command! Type: (/ChangePass (OldPass) (NewPass)).");
      strmid(oldpass,tmp,0,strlen(tmp));
      if(PINFO[playerid][Password]!=strval(oldpass))return SendClientMessage(playerid,GREY,"**(E)** You haven't typed all of the command! Type: (/ChangePass (OldPass) (NewPass))");
      tmp=strtok(cmdtext,idx);
      if(strlen(tmp)==0)return SendClientMessage(playerid,GREY,"**(E)** You haven't typed all of the command! Type: (/ChangePass (NewPass)).");
      strmid(newpass,tmp,0,strlen(tmp));
      PINFO[playerid][Password]=strval(newpass);
      OnPlayerUpdate(playerid);
      SendClientMessage(playerid,LGREEN,"**(I)** You have successfully changed your password! Don't forget it.");
      return 1;
    }
Reply
#2

A lot of admin scripts have working change password commands. You might want to check one of those out.
Reply
#3

I did but they use different systems e.g. MD5 dcmd
Reply
#4

Here's one which does then:

Raptor - Advanced Admin Script [Pixels^]
Reply
#5

Код:
if(strcmp(cmd, "/changepass", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
		    if(gPlayerLogged[playerid] == 0)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "   You need to login first.");
		        return 1;
		    }
		    else
		    {
		    	SendClientMessage(playerid, COLOR_GREY, " ");
			}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /changepass [password]");
				return 1;
			}
			strmid(PlayerInfo[playerid][pKey], tmp, 0, strlen(cmdtext), 255);
			OnPlayerUpdate(playerid);
			SendClientMessage(playerid, COLOR_YELLOW, "   Password has been changed successfuly");
		}
		return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)