Jump to content

Problema scoatere parole criptate


FeVosFeR

Recommended Posts

Salut! Am urmatorul cod:

Spoiler

        case DIALOG_NEWPASS: {
            if(!response) return 1;
            if(strcmp(MD5(inputtext), PlayerInfo[playerid][pKey]))
            {
                SCM(playerid, COLOR_RED2, "Parola invalida!");
                return 1;
            }
            ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "SERVER: Change Password","Type your NEW password bellow!","Done","Close");
        }

As vrea sa scot MD5 pentru a nu se mai cripta parolele dar cand scot doar cuvantul 'MD5' de acolo si dau restart la server, cand intru pe server si scriu /changepass si imi pun parola curenta, pica serverul. Ma puteti ajuta cumva?

Link to comment
Share on other sites

21 hours ago, [El.Capo] said:

arata dialogu' DIALOG_NEWPASS1

Poftim.

Spoiler

        case DIALOG_NEWPASS1: {
            if(response)
            {
                 new length = strlen(inputtext);
                if(length == 0 || length > 15) {
                    SendClientMessage(playerid, COLOR_WHITE, "Please enter another password (maximum 15 characters).");
                    ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "SERVER: Change Password", "Type your NEW password bellow!","Done","Close");
                    return 1;
                }
                if(strlen(inputtext) > 1 && strlen(inputtext) < 16) {
                    new tmppass[64],namee[30], strings[300];
                    mysql_real_escape_string(inputtext, tmppass);
                    format(PlayerInfo[playerid][pKey], 50, tmppass);
                    mysql_format(SQL, strings, sizeof(strings), "UPDATE users SET `password`='%s' WHERE `name`='%s'",PlayerInfo[playerid][pKey], PlayerInfo[playerid][pNormalName]);
                    mysql_tquery(SQL,strings,"","");
                    GetPlayerName(playerid, namee, sizeof(namee));
                    format(strings,sizeof(strings),"%s[user:%d] changed his password.",namee,PlayerInfo[playerid][pSQLID]);
                    ABroadCast(COLOR_YELLOW, strings,1);
                    SendClientMessage(playerid, COLOR_GREEN3, "Daca dai parola contului altcuiva, adminii nu te pot ajuta sa-ti recuperezi contul.");
                    SendClientMessage(playerid, COLOR_GREEN3, "E interzis sa incerci sa vinzi sau sa oferi la schimb contul din joc. Se sanctioneaza cu ban permanent.");
                    SendClientMessage(playerid, COLOR_YELLOW, "Password changed!");
                    format(strings,sizeof(strings),"Your new password is: {008080}%s.",tmppass);
                    SendClientMessage(playerid, COLOR_WHITE,strings);
                    return 1;
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "SERVER: Change Password", "Type your NEW password bellow!","Done","Close");
                    return 1;
                }
            }
            return 1;
        }

 

  • Upvote 1
Link to comment
Share on other sites

Acum 2 ore, FeVosFeR a spus:

Poftim.

  Ascunde conținuturi

        case DIALOG_NEWPASS1: {
            if(response)
            {
                 new length = strlen(inputtext);
                if(length == 0 || length > 15) {
                    SendClientMessage(playerid, COLOR_WHITE, "Please enter another password (maximum 15 characters).");
                    ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "SERVER: Change Password", "Type your NEW password bellow!","Done","Close");
                    return 1;
                }
                if(strlen(inputtext) > 1 && strlen(inputtext) < 16) {
                    new tmppass[64],namee[30], strings[300];
                    mysql_real_escape_string(inputtext, tmppass);
                    format(PlayerInfo[playerid][pKey], 50, tmppass);
                    mysql_format(SQL, strings, sizeof(strings), "UPDATE users SET `password`='%s' WHERE `name`='%s'",PlayerInfo[playerid][pKey], PlayerInfo[playerid][pNormalName]);
                    mysql_tquery(SQL,strings,"","");
                    GetPlayerName(playerid, namee, sizeof(namee));
                    format(strings,sizeof(strings),"%s[user:%d] changed his password.",namee,PlayerInfo[playerid][pSQLID]);
                    ABroadCast(COLOR_YELLOW, strings,1);
                    SendClientMessage(playerid, COLOR_GREEN3, "Daca dai parola contului altcuiva, adminii nu te pot ajuta sa-ti recuperezi contul.");
                    SendClientMessage(playerid, COLOR_GREEN3, "E interzis sa incerci sa vinzi sau sa oferi la schimb contul din joc. Se sanctioneaza cu ban permanent.");
                    SendClientMessage(playerid, COLOR_YELLOW, "Password changed!");
                    format(strings,sizeof(strings),"Your new password is: {008080}%s.",tmppass);
                    SendClientMessage(playerid, COLOR_WHITE,strings);
                    return 1;
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "SERVER: Change Password", "Type your NEW password bellow!","Done","Close");
                    return 1;
                }
            }
            return 1;
        }

 

Nu stiu ce ar putea fi incearca astea:

 

case DIALOG_NEWPASS: {
    if(!response) return 1;

    if(strcmp(inputtext, PlayerInfo[playerid][pKey])) return SCM(playerid, COLOR_RED2, "Parola invalida!");

    ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "SERVER: Change Password","Type your NEW password bellow!","Done","Close");
}

case DIALOG_NEWPASS1: {
    if(response)
    {
        new length = strlen(inputtext);
        if(length == 0 || length > 15) {
            SendClientMessage(playerid, COLOR_WHITE, "Please enter another password (maximum 15 characters).");
            ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "SERVER: Change Password", "Type your NEW password bellow!","Done","Close");
            return 1;
        }
        if(length > 1 || length < 16) {
            new tmppass[64],namee[30], strings[300];
            mysql_real_escape_string(inputtext, tmppass);
            format(PlayerInfo[playerid][pKey], 50, tmppass);
            mysql_format(SQL, strings, sizeof(strings), "UPDATE users SET `password`='%s' WHERE `name`='%s'",PlayerInfo[playerid][pKey], PlayerInfo[playerid][pNormalName]);
            mysql_tquery(SQL,strings,"","");
            GetPlayerName(playerid, namee, sizeof(namee));
            format(strings,sizeof(strings),"%s[user:%d] changed his password.",namee,PlayerInfo[playerid][pSQLID]);
            ABroadCast(COLOR_YELLOW, strings,1);
            SendClientMessage(playerid, COLOR_GREEN3, "Daca dai parola contului altcuiva, adminii nu te pot ajuta sa-ti recuperezi contul.");
            SendClientMessage(playerid, COLOR_GREEN3, "E interzis sa incerci sa vinzi sau sa oferi la schimb contul din joc. Se sanctioneaza cu ban permanent.");
            SendClientMessage(playerid, COLOR_YELLOW, "Password changed!");
            format(strings,sizeof(strings),"Your new password is: {008080}%s.",tmppass);
            SendClientMessage(playerid, COLOR_WHITE,strings);
            return 1;
        }
        else return ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "SERVER: Change Password", "Type your NEW password bellow!","Done","Close");
    }
    return 1;
}

  • Upvote 2
Link to comment
Share on other sites

26 minutes ago, [El.Capo] said:

Nu stiu ce ar putea fi incearca astea:

 

case DIALOG_NEWPASS: {
    if(!response) return 1;

    if(strcmp(inputtext, PlayerInfo[playerid][pKey])) return SCM(playerid, COLOR_RED2, "Parola invalida!");

    ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "SERVER: Change Password","Type your NEW password bellow!","Done","Close");
}

case DIALOG_NEWPASS1: {
    if(response)
    {
        new length = strlen(inputtext);
        if(length == 0 || length > 15) {
            SendClientMessage(playerid, COLOR_WHITE, "Please enter another password (maximum 15 characters).");
            ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "SERVER: Change Password", "Type your NEW password bellow!","Done","Close");
            return 1;
        }
        if(length > 1 || length < 16) {
            new tmppass[64],namee[30], strings[300];
            mysql_real_escape_string(inputtext, tmppass);
            format(PlayerInfo[playerid][pKey], 50, tmppass);
            mysql_format(SQL, strings, sizeof(strings), "UPDATE users SET `password`='%s' WHERE `name`='%s'",PlayerInfo[playerid][pKey], PlayerInfo[playerid][pNormalName]);
            mysql_tquery(SQL,strings,"","");
            GetPlayerName(playerid, namee, sizeof(namee));
            format(strings,sizeof(strings),"%s[user:%d] changed his password.",namee,PlayerInfo[playerid][pSQLID]);
            ABroadCast(COLOR_YELLOW, strings,1);
            SendClientMessage(playerid, COLOR_GREEN3, "Daca dai parola contului altcuiva, adminii nu te pot ajuta sa-ti recuperezi contul.");
            SendClientMessage(playerid, COLOR_GREEN3, "E interzis sa incerci sa vinzi sau sa oferi la schimb contul din joc. Se sanctioneaza cu ban permanent.");
            SendClientMessage(playerid, COLOR_YELLOW, "Password changed!");
            format(strings,sizeof(strings),"Your new password is: {008080}%s.",tmppass);
            SendClientMessage(playerid, COLOR_WHITE,strings);
            return 1;
        }
        else return ShowPlayerDialog(playerid, DIALOG_NEWPASS1,DIALOG_STYLE_INPUT, "SERVER: Change Password", "Type your NEW password bellow!","Done","Close");
    }
    return 1;
}

A functionat. Mersi mult!

Ai +1.

Cer T/C.

Link to comment
Share on other sites

  • Mister locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.