dini creating the wrong password
#1

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

I can't find any problem here !
Reply
#3

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

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

removed.
Reply
#6

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!
Reply
#7

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!
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)