SA-MP Forums Archive
Register Login system problem? - 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)
+--- Thread: Register Login system problem? (/showthread.php?tid=575737)



Register Login system problem? - baba1234 - 29.05.2015

So Ive made an clickable txd login reg system and I have a problem. When someone tries to login and if he type a wrong password it will open a new dialog saying that he entered the worng password but then when he type another wrong password it will spawn him saying he logged in...

Код:
if(dialogid == DIALOG_LOGIN)
        {
            if ( !response ) return Kick(playerid);
            if( response )
            {
				new HashPass[129];
   				WP_Hash(HashPass, sizeof(HashPass), inputtext);
                if(strcmp(HashPass, PlayerInfo[playerid][pPass]) == 0)
                {
	                INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
	                TogglePlayerSpectating(playerid, 0);
	                SetSpawnInfo( playerid, 0, 0, 1714.8339, -1912.6870, 13.5666, 359.9943, 26, 36, 28, 150, 0, 0 );
	                SpawnPlayer(playerid);
	                GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]);
                }else
                {
					ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_BIJELA"Balkan Godfather-"COL_ZLATNA"Login",""COL_ZLATNA"_______________________\n\n"COL_BIJELA"Unijeli ste "COL_CRVENA"pogresnu Lozinku!\n\n"COL_BIJELA"Pokusaj "COL_ZLATNA"Ponovo!\n"COL_ZLATNA"_______________________","Uredu","Odustani");
					return 1;
                }
            }
        }
What am I doing wrong?


Re : Register Login system problem? - AlexBlack - 29.05.2015

try to replace this :

PHP код:
if(strcmp(HashPassPlayerInfo[playerid][pPass]) == 0
to this

PHP код:
if(!strcmp(HashPassPlayerInfo[playerid][pPass])) 
some times it's work for me.


Re: Register Login system problem? - baba1234 - 29.05.2015

Nope It doesnt work I think that it is not becouse of dialog response I think that this comes from something else


Re : Register Login system problem? - AlexBlack - 29.05.2015

and when you type the right password what's happen?


Re: Register Login system problem? - baba1234 - 29.05.2015

when I type right pass it let me in and when I type wrong pass it let me in


Re: Register Login system problem? - shadowdog - 29.05.2015

It probably means that your PlayerInfo[playerid][pPass] is empty.

Check with if(strlen(PlayerInfo[playerid][pPass]) > 0).