change pass not working
#1

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;

Reply
#2

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

I make it like this

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)