SA-MP Forums Archive
i put right password,but... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: i put right password,but... (/showthread.php?tid=138097)



i put right password,but... - Lajko1 - 31.03.2010

Hello i have problems with my code as allways.

this time when i registered my acc its all OK,but wheni dissconect and conenct again (relog) and PUT the RIGHT PASSWORD in box it send me a message that i write wrong password,here is my code

Код:
if(dialogid == 2) // Login Dialog
	{
		TogglePlayerControllable(playerid, 0);
		new name[24], file[128];
		GetPlayerName(playerid, name, sizeof(name));
		format(file,sizeof(file),"/KA/Users/%s.ini",name);
		if(response == 1)
		{
			if(dini_Int(file, "Password") == udb_hash(inputtext))
			{
			 	SetPlayerMoney(playerid, dini_Int(file, "Cash"));
				PlayerInfo[playerid][pALevel] = dini_Int(file, "AdminLevel");
				SendClientMessage(playerid, 0x00ff41ff, "[System]: You successfuly loged in!");
				return 1;
			}
			else
			{
			  SendClientMessage(playerid, 0xff7000ff, "[System]: You entered wrong password!");
			  Kick(playerid);
			  return 1;
			}
		}
	}



Re: i put right password,but... - wafffllesss - 31.03.2010

try this:
pawn Код:
if(dialogid == 2) // Login Dialog
    {
        TogglePlayerControllable(playerid, 0);
        new name[24], file[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(file,sizeof(file),"/KA/Users/%s.ini",name);
        if(response == 1)
        {
            if(!strcmp(dini_Int(file, "Password"),udb_hash(inputtext),false) && strlen(inputtext))
            {
                SetPlayerMoney(playerid, dini_Int(file, "Cash"));
                PlayerInfo[playerid][pALevel] = dini_Int(file, "AdminLevel");
                SendClientMessage(playerid, 0x00ff41ff, "[System]: You successfuly loged in!");
                return 1;
            }
            else
            {
              SendClientMessage(playerid, 0xff7000ff, "[System]: You entered wrong password!");
              Kick(playerid);
              return 1;
            }
        }
    }



Re: i put right password,but... - Lajko1 - 31.03.2010

Quote:
Originally Posted by wafffllesss
try this:
pawn Код:
if(dialogid == 2) // Login Dialog
    {
        TogglePlayerControllable(playerid, 0);
        new name[24], file[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(file,sizeof(file),"/KA/Users/%s.ini",name);
        if(response == 1)
        {
            if(!strcmp(dini_Int(file, "Password"),udb_hash(inputtext),false) && strlen(inputtext))
            {
                SetPlayerMoney(playerid, dini_Int(file, "Cash"));
                PlayerInfo[playerid][pALevel] = dini_Int(file, "AdminLevel");
                SendClientMessage(playerid, 0x00ff41ff, "[System]: You successfuly loged in!");
                return 1;
            }
            else
            {
              SendClientMessage(playerid, 0xff7000ff, "[System]: You entered wrong password!");
              Kick(playerid);
              return 1;
            }
        }
    }
Код:
C:\Documents and Settings\samp\Desktop\Server 2\gamemodes\Roleplay.pwn(121) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Код:
if(!strcmp(dini_Int(file, "Password"),udb_hash(inputtext),false) && strlen(inputtext))



Re: i put right password,but... - Last_Stand_Guardian - 31.03.2010

Try:
Quote:
Originally Posted by Lajko1
Код:
if(!(strcmp(dini_Int(file, "Password"),udb_hash(inputtext),false) && strlen(inputtext)))



Re: i put right password,but... - rabit7 - 31.03.2010

Quote:
Код:
C:\Documents and Settings\samp\Desktop\Server 2\gamemodes\Roleplay.pwn(121) : error 035: argument type mismatch (argument 1)
Where is this warning?


Re: i put right password,but... - biltong - 31.03.2010

Quote:
Originally Posted by rabit7
Quote:
Код:
C:\Documents and Settings\samp\Desktop\Server 2\gamemodes\Roleplay.pwn(121) : error 035: argument type mismatch (argument 1)
Where is this warning?
I have looked at all your posts and by the looks of things, you telling people to post their code is useless since you won't be able help because you're still learning.

Now if you actually READ THE POST, you would see he actually posted the line, so STOP SPAMMING YOU POST COUNT.

biltong


Re: i put right password,but... - MadeMan - 31.03.2010

How do you save the password?


Re: i put right password,but... - Lajko1 - 01.04.2010

with inputtext

Dini_Set( blablablal ''password'',inputtext);

its something like this i am not on my computer so i can't show more code


Re: i put right password,but... - Lajko1 - 02.04.2010

anyone?