[HELP]Can Not save the passwords..
#6

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
pawn Код:
if(dialogid == 1)
    {
        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)) return Kick(playerid); //Change it!! return anything you want over here!
            dini_Create(file);
            dini_IntSet(file, "pw", udb_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);
        }
    }

    // Add this anywhere in the GM But not in a function!
    /*Credits to Dracoblue*/
    stock udb_hash(buf[])
    {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
    }
Doesn't work
Reply


Messages In This Thread
[HELP]Can Not save the passwords.. - by ServerScripter - 05.02.2012, 15:13
Re: [HELP]Can Not save the passwords.. - by Konstantinos - 05.02.2012, 15:26
Re: [HELP]Can Not save the passwords.. - by Ballu Miaa - 05.02.2012, 15:29
Re: [HELP]Can Not save the passwords.. - by ServerScripter - 05.02.2012, 15:29
Re: [HELP]Can Not save the passwords.. - by Konstantinos - 05.02.2012, 15:32
Re: [HELP]Can Not save the passwords.. - by ServerScripter - 05.02.2012, 15:33
Re: [HELP]Can Not save the passwords.. - by Ballu Miaa - 05.02.2012, 15:36
Re: [HELP]Can Not save the passwords.. - by ServerScripter - 05.02.2012, 15:38
Re: [HELP]Can Not save the passwords.. - by Ballu Miaa - 05.02.2012, 15:40
Re: [HELP]Can Not save the passwords.. - by ServerScripter - 05.02.2012, 15:48

Forum Jump:


Users browsing this thread: 1 Guest(s)