31.01.2011, 22:54
Hey guys, i use mysql, i want to make a command that allows players to change their own passwords, Lethal helped me out by giving me this code.
At the end it tells me that i've changed my password to: BlaBla.
In reality tho, it does not change it in database, am i missing some code? Please help, thanks.
PHP код:
CMD:changepass(playerid, params[])
{
new
EscPass[40],
Query[128],
iStr[55];
if(isnull(params)) return SendClientMessage(playerid, -1, ""#CRED"Usage: "#CORANGE"/ChangePass < New Password >");
mysql_real_escape_string(params, EscPass);
format(Query, sizeof(Query), "UPDATE `playerinfo` SET `password` = md5('%s') WHERE `user` = '%s'", EscPass, pName(playerid));
mysql_query(Query);
format(iStr, sizeof(iStr), "You've changed your password to: "#CBLUE"%s", params);
SendClientMessage(playerid, -1, iStr);
return 1;
}
In reality tho, it does not change it in database, am i missing some code? Please help, thanks.