HELP fix saving password bug [dutils+dini]
#1

Introduction :
The problem is simple : in registration :whene i type for an example the password "samp" , and i /q the server , i connect to the server again , but whene i type "samp" , it says : Wrong password , so i check my .ini file , but found pw=0 (password must be "samp" ..)

Registration system :
pawn Код:
if(dialogid == 1) { // the id of our registration dialog
        new file[128], name[MAX_PLAYER_NAME], str[128];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(file, sizeof(file), "LATDM/users/%s.ini", name);
        if(response) {
            if(strlen(inputtext)) {
                dini_Create(file);
                dini_IntSet(file, "pw", num_hash(inputtext));
                dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
                dini_IntSet(file, "VipLevel", PlayerInfo[playerid][VipLevel]);
                dini_IntSet(file, "cash", PlayerInfo[playerid][cash]);
                dini_IntSet(file, "score", PlayerInfo[playerid][score]);
                format(str, sizeof(str), "You are registered as ~r~ %s. Your password is ~r~ %s. /changepass to change it", name, inputtext);
                SendClientMessage(playerid, -1, str);
                PlayerInfo[playerid][score] = dini_Int(file, "score");
                PlayerInfo[playerid][cash] = dini_Int(file, "cash");
                PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
                PlayerInfo[playerid][VipLevel] = dini_Int(file, "VipLevel");
            }
        }
        else {
            Kick(playerid);
        }
    }
Thanks:
i hope if you help me , cause it is the only bug who i must fix to progress in my server .

Testing:
You can test registration/login system and see the bug here : 105.136.149.136:7777
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)