#5

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.
Reply


Messages In This Thread
Hash - by Loinal - 31.05.2017, 22:36
Re: Hash - by Sew_Sumi - 31.05.2017, 22:48
Re: Hash - by Loinal - 31.05.2017, 23:14
Re: Hash - by DaniceMcHarley - 31.05.2017, 23:23
Re: Hash - by Sew_Sumi - 31.05.2017, 23:29
Re: Hash - by NewFreeroamStunt - 31.05.2017, 23:31
Re: Hash - by Loinal - 31.05.2017, 23:32
Re: Hash - by GoldenLion - 01.06.2017, 05:29
Re: Hash - by Loinal - 01.06.2017, 09:47
Re: Hash - by GoldenLion - 01.06.2017, 13:32

Forum Jump:


Users browsing this thread: 1 Guest(s)