Register System Help.
#1

Hey i have that register System: https://sampforum.blast.hk/showthread.php?tid=273088
i want do the Password UnHashed!

i ma revome it:
Код:
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;
}
and its do some Errors How ti fix it \/
Код:
H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(1024) : error 017: undefined symbol "udb_hash"
H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(1042) : error 017: undefined symbol "udb_hash"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Line 1024 & 1042
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext)); // ------------------ Line 1024
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);

//                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN" - Have a Fun!!! -","Ok","");
			}
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass]) // ------------ Line 1042
                {
                    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","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}
How to fix it?
Reply
#2

Please Help!
Reply
#3

Line 1024:

pawn Код:
INI_WriteInt(File,"Password",inputtext);
Line 1042:

pawn Код:
if((inputtext) == PlayerInfo[playerid][pPass])
Not sure if it's correct tbh.
Reply
#4

Now how to fix it??
Код:
H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(1024) : error 035: argument type mismatch (argument 3)
H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(1042) : error 033: array must be indexed (variable "inputtext")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#5

pawn Код:
INI_WriteInt(File,"Password",inputtext);
I think a password which you want to save would be a string, not integer. Use a different function to save it.
Reply
#6

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
Use a different function to save it.
Like What?, Can you give me a script or something like this
Reply
#7

You already using it.. is it an Y_ini i guess?
Reply
#8

But How to do the pass unhashed??
Reply
#9

@Logitech90, already done it for you, but there's a mistake which i told you.
Reply
#10

But its do errors
Код:
H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(1024) : error 035: argument type mismatch (argument 3)
H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(1042) : error 033: array must be indexed (variable "inputtext")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)