SA-MP Forums Archive
dini creating the wrong password - 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: dini creating the wrong password (/showthread.php?tid=480002)



dini creating the wrong password - Sawalha - 08.12.2013

hi,
there's some problem in dini, when the player registers , the password saves as numbers... :/ before some days i was seeing some register tutorials and some of them had the correct way to save password, i have forget which one :/
i will show you register cmd code:
pawn Код:
CMD:register(playerid, params[])
{
    new file[128] , pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "Users/%s.ini", pname);
    if(sscanf(params, "s", "Password"))  return SendClientMessage(playerid, RED, "Use /register password");
    if(!fexist(file))
    {
        dini_Create(file);
            dini_Set(file, "Password", params);
        dini_IntSet(file, "Level", 0);
        dini_IntSet(file, "Score", GetPlayerScore(playerid));
        dini_IntSet(file, "Money", GetPlayerMoney(playerid));
        dini_IntSet(file, "Deaths", PlayerInfo[playerid][Deaths]);
        dini_IntSet(file, "Kills", PlayerInfo[playerid][Kills]);
        new string[128];
        format(string, sizeof(string), "[SYSTEM] You have been sucessfully registered! You password is: {FF1E00}%s", params);
        SendClientMessage(playerid, GREEN, string);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        PlayerInfo[playerid][logged] = 1;
    }
   
    else
    {
        SendClientMessage(playerid, RED, "You are already registered.");
    }
    return 1;
}
Thanks. ..


Re : dini creating the wrong password - FilesMAker - 08.12.2013

I can't find any problem here !


Re: dini creating the wrong password - Voxel - 08.12.2013

Does it also have letters? I think you are using a "Whirlpool hash" to encrypt the password for security, try registering with "test123" as password and relog and try logging in with that password. If it works then you indeed have a WP hash.


Re: dini creating the wrong password - Emmet_ - 08.12.2013

Try this - you were using sscanf incorrectly:

pawn Код:
CMD:register(playerid, params[])
{
    new
        file[40],
        string[128],
        pname[MAX_PLAYER_NAME];
   
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "Users/%s.ini", pname);
   
    if (isnull(params))
        return SendClientMessage(playerid, RED, "Use /register password");
   
    if (!fexist(file))
    {
        dini_Create(file);
        dini_Set(file, "Password", params);
        dini_IntSet(file, "Level", 0);
        dini_IntSet(file, "Score", GetPlayerScore(playerid));
        dini_IntSet(file, "Money", GetPlayerMoney(playerid));
        dini_IntSet(file, "Deaths", PlayerInfo[playerid][Deaths]);
        dini_IntSet(file, "Kills", PlayerInfo[playerid][Kills]);
       
        format(string, sizeof(string), "[SYSTEM] You have been sucessfully registered! You password is: {FF1E00}%s", params);
        SendClientMessage(playerid, GREEN, string);

        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        PlayerInfo[playerid][logged] = 1;
    }
    else
    {
        SendClientMessage(playerid, RED, "You are already registered.");
    }
    return 1;
}
You shouldn't really use dini, but that's entirely up to you. Also, hash your passwords please!


Re: dini creating the wrong password - Sawalha - 08.12.2013

removed.


Re: dini creating the wrong password - SilentSoul - 08.12.2013

Quote:
Originally Posted by Sawalha
Посмотреть сообщение
mm didn't work.. i think i'll not use dini .. what do you think to me is best to use?
@ voxel, thanks mate but i will not use dini
Use Y_INI Fast INI file reading and writing , also easy to use like dini but dini is old and outdated also!
How to use y_ini
Download!


Re: dini creating the wrong password - Voxel - 08.12.2013

Or you could go even more faster and go with sqlite which doesn't need any plug ins or includes because it's included in samp. I got a easy sqlite database starter script that you should check out!


Re: dini creating the wrong password - Sawalha - 09.12.2013

i can't understand them both , hard to understand, btw about dini Fixed DDDDDDDDDDD