Posts: 6,242
Threads: 8
Joined: Jun 2008
Quote:
Originally Posted by Loinal
I have a command to set the password of an offline player that help me in that but its not working it doesn't set the player password correctly
PHP код:
CMD:setpassword(playerid, params[])
{
if(pData[playerid][Admin] >= 7)
{
new query[320], name[24], newpass[34], hash1[34];
if(sscanf(params, "s[24]s[34]", name, newpass)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /setpassword <PlayerName> <NewPassword>");
if(!AccountExists(name)) return SendClientMessage(playerid, red, "Account does not exists");
WP_Hash(hash1, 129, newpass);
mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `Password` = '%e' WHERE `Username` = '%e'", hash1, name);
mysql_tquery(mysql, query);
format(query, sizeof(query), "You have changed %s's password to %s", name, newpass);
SendClientMessage(playerid, COLOR_GREEN, query);
new IRC[130];
format(IRC, sizeof(IRC), "1,8* Admin %s (ID: %d) changed %s's password to %s .",GetName(playerid), playerid, name, newpass);
IRC_GroupSay(groupID, "&#ZoneX", IRC);
IRC_GroupSay(groupID, IRC_aCHANNEL, IRC);
return 1;
}
else return ShowMessage(playerid, COLOR_YELLOW, 1, 7);
}
|
Why are you even broadcasting this to the IRC channel? This is definitely dangerous.