16.07.2011, 21:56
Quote:
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. |
Код:
if(OldPass == NewPass) return SendClientMessage(playerid, COLOR_RED, "ERROR: You typed same password");
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; }
error 032: array index out of bounds (variable "OldPass")