Setpass
#1

PHP код:
CMD:setpassword(playeridparams[])
{
    if(
pData[playerid][Admin] >= 7)
    {
        new 
query[320], name[24], newpass[34],query1[320];
        if(
sscanf(params"s[24]s[34]"namenewpass)) return SendClientMessage(playeridCOLOR_YELLOW"USAGE: /setpassword <PlayerName> <NewPassword>");
        if(!
AccountExists(name)) return SendClientMessage(playeridred"Account does not exists");
        
mysql_format(mysqlquerysizeof(query),"SELECT `Password` FROM `players` WHERE `Username` = '%e'");
        
mysql_tquery(mysql,query);
        
        
mysql_tquery(mysqlquery"ChangePlayerPassword""iss"playerid,name,newpass);
        
format(query1sizeof(query1), "You have changed %s's password to %s"namenewpass);
        
SendClientMessage(playeridCOLOR_GREENquery1);
        new 
IRC[130];
        
format(IRCsizeof(IRC), "1,8* Admin %s (ID: %d) changed %s's password.",GetName(playerid), playeridname);
        
IRC_GroupSay(groupID"&#ZoneX"IRC);
        
IRC_GroupSay(groupIDIRC_aCHANNELIRC);
        return 
1;
    }
    else return 
ShowMessage(playeridCOLOR_YELLOW17);
}
forward ChangePlayerPassword(admincPlayer[], newpassword[]);
public 
ChangePlayerPassword(admincPlayer[], newpassword[])
{
    new 
query[320];
    
mysql_format(mysqlquerysizeof(query), "UPDATE `players` SET Password=SHA1('%s') WHERE `Username` = '%e'"newpasswordcPlayer);
    
mysql_tquery(mysqlquery);
    return 
true;

That command doesn't change the password why?
Reply


Messages In This Thread
Setpass - by Loinal - 21.07.2017, 17:57
Re: Setpass - by DobbysGamertag - 21.07.2017, 18:06
Re: Setpass - by Vince - 21.07.2017, 18:29
Re: Setpass - by Loinal - 21.07.2017, 19:42

Forum Jump:


Users browsing this thread: 1 Guest(s)