Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Finch on Apr 08, 2015, 05:15 AM

Title: Password Fuzzie Account
Post by: Finch on Apr 08, 2015, 05:15 AM
Well i am using Fuzzie Account system but i am facing problem on setpassword command when i set password it say on console password does not exist and password also didnt change this is command

else if ( cmd == "setpassword" )
{
           if( stats[ player.ID ].Logged == false ) MessagePlayer( "Error - You don't have Login acess.", player);
   else if ( stats[ player.ID ].Level < 7 ) MessagePlayer( "Error - You don't have access to it.", player);
else if ( !text ) qPrivMessage( "Syntax, " + cmd + " [Nick/ID] [Password]",player );
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) qPrivMessage( "Error: Invalid Player.",player );
else {
local newpass = GetTok( text, " ", 2);
if ( newpass == null ) qPrivMessage("Enter A Valid Password.",player );
else {
qPrivMessage("Admin " + player + " Set Your Password To: " + newpass + ".", plr);
qPrivMessage(" Changed Password Of " + plr.Name + " To: " + newpass + ".", player);
QuerySQL(sqliteDB,"UPDATE Accounts SET Password='" + SHA256( password ) + "' WHERE Name='" + plr.Name + "'");
}
}
}
}
Title: Re: Password Fuzzie Account
Post by: Thijn on Apr 08, 2015, 05:37 AM
You copy pasted the query, but you have to change "password" in the SHA256 function to newpass.
Title: Re: Password Fuzzie Account
Post by: Finch on Apr 08, 2015, 06:38 AM
can u give there example?
Title: Re: Password Fuzzie Account
Post by: EK.IceFlake on Apr 08, 2015, 09:18 AM
Quote from: Finch on Apr 08, 2015, 06:38 AMcan u give there example?
Change
QuerySQL(sqliteDB,"UPDATE Accounts SET Password='" + SHA256( password ) + "' WHERE Name='" + plr.Name + "'");to
QuerySQL(sqliteDB,"UPDATE Accounts SET Password='" + SHA256( newpass ) + "' WHERE Name='" + plr.Name + "'");And please, next time FREAKING TRY TO FIND THE ERROR INSTEAD OF POSTING A EXABILLION STUPID ERROR TOPICS HERE!!!
Edit: I noticed this is my 123rd post :P