Dini Question...
#1

How can I make that dini saves players password and when he wants to login dini checks his password....

(I don't know if you'll understand what I want to say xD)

I have this code...for login

pawn Код:
if(dialogid == 4)
    {
        if(!response)
            {
                SendClientMessage(playerid, COLOR_RED, "You need to login in order to play.");
                return Kick(playerid);
            }
        new file[128];
        new string[MAX_STRING], pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(file, sizeof(file), "/users/%s.ini", pname);
        new tmp;
        tmp = dini_Int(file, "hashPW");
        if(udb_hash(inputtext) != tmp)
        {
            format(string, 256, "Password you typed is wrong for name %s!", pname);
            SendClientMessage(playerid, COLOR_RED, string);
            new stringlog[128];
            format(stringlog, sizeof(stringlog), "Welcome %s, we fount Your account in our database.\nTo login type your password bellow.", pname);
            ShowPlayerDialog(playerid, LOGIN_DIALOG,DIALOG_STYLE_INPUT,"[RAZER SYSTEM]: Registered!", stringlog, "Login","Quit");
        }
        else
        {
...............
and every time I try to login it says that it's wrong password.... :S I don't really know what I need to do...
Reply
#2

pawn Код:
if(udb_hash(inputtext) != strval(tmp))
Try the above instead of

pawn Код:
if(udb_hash(inputtext) != tmp)
Reply
#3

Quote:
Originally Posted by CrucixTM
Посмотреть сообщение
pawn Код:
if(udb_hash(inputtext) != strval(tmp))
Try the above instead of

pawn Код:
if(udb_hash(inputtext) != tmp)
I get this:

pawn Код:
(25231) : error 035: argument type mismatch (argument 1)
 (25230) : warning 204: symbol is assigned a value that is never used: "tmp"
And these are the lines
pawn Код:
tmp = dini_Int(file, "hashPW"); // <----25231
            if(udb_hash(inputtext) != strval(tmp))// <----25230
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)