04.06.2009, 21:19
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:
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;
}