Register Login system problem?
#1

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?
Reply
#2

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.
Reply
#3

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

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

when I type right pass it let me in and when I type wrong pass it let me in
Reply
#6

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)