Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: KAKAN on Aug 15, 2015, 10:15 AM

Title: changepass
Post by: KAKAN on Aug 15, 2015, 10:15 AM
  if ( cmd == "changepass" )
{
if (!text) PrivMessage( player, "Correct syntax: /changepass <new password>" );
else
{
QuerySQL( sqliteDB, "UPDATE hujia SET hujiaPassword='" + ::SHA256( text.tolower() ) + "' WHERE Name='" + player.Name + "' AND NameLower='" + player.Name.tolower() + "'" );   
MessagePlayer("You have successfully changed your password to " + text, player );
}
}

I get the message that i have successfully changed my password, but it didn't get changed
Title: Re: changepass
Post by: Mashreq on Aug 15, 2015, 11:10 AM
Firstly, Why do you use :: for SHA256? There's no need of using it.
Secondly, Why do you insert the password as .tolower() form?

Try using the following command. it should be working fine.
  if ( cmd == "changepass" )
{
if (!text) PrivMessage( player, "Correct syntax: /changepass <new password>" );
else
{
QuerySQL( sqliteDB, "UPDATE hujia SET hujiaPassword='" + SHA256( text ) + "' WHERE Name='" + player.Name + "'" );   
MessagePlayer("You have successfully changed your password to " + text, player );
}
}