Problem with strcmp
#2

Use this hashing stock 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;
}
for login do this.
Код:
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
Reply


Messages In This Thread
Problem with strcmp - by verlaj - 27.05.2014, 05:56
Re: Problem with strcmp - by Rittik - 27.05.2014, 06:06
Re: Problem with strcmp - by verlaj - 27.05.2014, 06:15
Re: Problem with strcmp - by Rittik - 27.05.2014, 06:18
Re: Problem with strcmp - by Rittik - 27.05.2014, 07:46
Re: Problem with strcmp - by verlaj - 27.05.2014, 08:01
Re: Problem with strcmp - by iZN - 27.05.2014, 08:01
Re: Problem with strcmp - by Jack_Leslie - 27.05.2014, 08:07
Re: Problem with strcmp - by verlaj - 27.05.2014, 08:12

Forum Jump:


Users browsing this thread: 2 Guest(s)