/changepass problem
#5

Quote:
Originally Posted by Kyosaur
Посмотреть сообщение
Yes, both of them as they are indeed strings. You compare strings using the function strcmp, so change you're same password check to use that.


Also, you should make sure the old pass matches the actual old password before setting a new one.
to check if the player didn't tape the same pass i use this
Код:
if(OldPass == NewPass) return SendClientMessage(playerid, COLOR_RED, "ERROR: You typed same password");
now even if i put strings for OldPass and NewPass , i still havng errors ...
i'll show you the commande maybe you could help me
Код:
CMD:changepass(playerid, params[])
{
	new file[128];
	format(file, 128, USER_FILE, GetPName(playerid));
    new OldPass[50], NewPass[50];
    if(sscanf(params, "ss", OldPass, NewPass)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /changepass (password) (new password)");
    if(OldPass == NewPass) return SendClientMessage(playerid, COLOR_RED, "ERROR: You typed same password");
	dini_IntSet(file, "Password", udb_hash(NewPass));	
    SendClientMessage(playerid, COLOR_RED, "You have changed your password.");
    return 1;
}
and this is the error
error 032: array index out of bounds (variable "OldPass")
Reply


Messages In This Thread
/changepass problem - by Amine_Mejrhirrou - 16.07.2011, 21:25
Re: /changepass problem - by Vince - 16.07.2011, 21:32
Re : /changepass problem - by Amine_Mejrhirrou - 16.07.2011, 21:40
Re: Re : /changepass problem - by Kyosaur - 16.07.2011, 21:50
Re : Re: Re : /changepass problem - by Amine_Mejrhirrou - 16.07.2011, 21:56
Re: /changepass problem - by Kyosaur - 16.07.2011, 22:07
Re: /changepass problem - by PotH3Ad - 16.07.2011, 22:15
Re : /changepass problem - by Amine_Mejrhirrou - 16.07.2011, 23:16

Forum Jump:


Users browsing this thread: 2 Guest(s)