31.01.2011, 02:25
MD5 is way of hashing passwords, that way it protects their passwords from others to see.
You can't change the passwords from DB
^ Admin command.
You can't change the passwords from DB
pawn Код:
CMD:changeppass(playerid, params[])
{
if(PVar[playerid][pLevel] >= 4)
{
new
EscPass[40],
Query[128],
iStr[80],
PID;
if(sscanf(params, "us[40]", PID, params)) return SendClientMessage(playerid, -1, ""#CRED"Usage: "#CORANGE"/ChangePPass < Player ID > < New Password >");
if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_RED, "That user is not connected!");
mysql_real_escape_string(params, EscPass);
format(Query, sizeof(Query), "UPDATE `playerinfo` SET `password` = md5('%s') WHERE `user` = '%s'", EscPass, pName(PID));
mysql_query(Query);
format(iStr, sizeof(iStr), ""#CDGREEN"Admin: %s(%d) has changed your pass to: "#CBLUE"%s", pName(playerid), playerid, params);
SendClientMessage(PID, -1, iStr);
return 1;
}
else return SendClientMessage(playerid, COLOR_RED, "Only admin level 4 + can use that command!");
}