SA-MP Forums Archive
change pass not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: change pass not working (/showthread.php?tid=658022)



change pass not working - ServerFiles - 21.08.2018

my change pass not working, they still need to login using their old password.

PHP код:
dcmd_changepass(playerid,params[])
{
    if(!
strcmp(params,"666",true))
    {
        
ShowPlayerDialog(playerid3DIALOG_STYLE_PASSWORD"> Password""Please enter your new password.""Change""Cancel");
         return 
1;
    }
    if (
strlen(params) < 3)
    {
        
SendClientMessage(playerid,COLOR_SYSTEM_GM,"Error, the password is too short");
        
ShowPlayerDialog(playerid3DIALOG_STYLE_PASSWORD"> Password""Please enter your new password.""Change""Cancel");
         return 
1;
    }
    if(
strlen(params)>17)
    {
        
SendClientMessage(playerid,COLOR_SYSTEM_GM,"Error, the password is too long");
        
ShowPlayerDialog(playerid3DIALOG_STYLE_PASSWORD"> Password""Please enter your new password.""Change""Cancel");
         return 
1;
    }
    new 
hashed[129], sQuery[528];
    
WP_Hash(hashed129params);
    
mysql_format(sqldbsQuerysizeof sQuery"UPDATE `PlayerInfo` SET `Password` = '%e' WHERE `PlayerName` = '%e'"hashedPlayerName(playerid));
    
SendClientMessage(playerid,COLOR_SYSTEM_GM,"..: SUCCESS: Your password has been changed. :..");
    return 
1;




Re: change pass not working - DTV - 21.08.2018

I don't see anywhere where you type anything past /changepass. I think it's looking for what comes after the command when you type it in chat, when you use dialogs, you have to go to OnDialogResponse to get the password they type in to save it properly.


Re: change pass not working - ServerFiles - 21.08.2018

I make it like this

PHP код:
    if(dialogid == && response == 1)
    {
         
dcmd_changepass(playeridinputtext);
        return 
1;
    } 



Re: change pass not working - Shockey HD - 21.08.2018

You are not executing the query after formating it.

PHP код:
mysql_tquery(connectionHandlequery[], callback[] = ""format[] = "", {Float,_}:...) 
https://sampwiki.blast.hk/wiki/MySQL/R33#mysql_tquery


Someone correct me if I'm wrong (being that I haven't SAMP scripted in ages) but I believe the new version of MySQL automatically enables logs for MYSQL under the logs > Plugins folder of your server files to check if you have any SQL error codes. But as stated above, I'm certain you need to execute your query.


Re: change pass not working - KinderClans - 21.08.2018

HASH YOUR PASSWORDS in a properly way!! Stick to SHA256 and salt instead of wp_hash!