SA-MP Forums Archive
mixes passwords - 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: mixes passwords (/showthread.php?tid=230383)



mixes passwords - WardenCS - 23.02.2011

Hello,i got a problem with my script,i just started a new server and i heard some people saying that they cant log in,then i checked their passwords,and i saw that their passwords has been changed to someones other password,i dont know understand how so can you guys help me?heres the login/register maybe it comes from here :

Код:
	            	    case 1:
	    {
			GetFromAccount( PlayerStatistics[ playerid ][ pDatabaseID ], "Password", PlayerStatistics[ playerid ][ pPassword ] );

			if( strcmp( inputtext, PlayerStatistics[ playerid ][ pPassword ], true ) == 0 )
			{
  			if( strlen( inputtext ) >= 1 )
	            {
			    new String[ 128 ], Name[ MAX_PLAYER_NAME ];

			    GetPlayerName( playerid, Name, sizeof( Name ) );

			    format( String, sizeof( String ), "Thank you for logging in, %s.", Name );
			    SendClientMessage( playerid, WHITE, String );
		    	FirstDeath[playerid] = 0;
		    	new Fstyle = PlayerStatistics[playerid][pFightstyle];
		    	SetPlayerFightingStyle (playerid, Fstyle);
		    	if(PlayerStatistics[playerid][pBanned] == 1)
		    	{
	    		SendClientMessage(playerid,COLOR_WHITE,"This account is banned.");
   			 	Ban(playerid);
 				}

			    PlayerStatistics[ playerid ][ pAuth ] = 1;
			    LoadAccountVariables( playerid );

				if(PlayerStatistics[ playerid ][ pTutorial ] == 0)
				{
  	    		TogglePlayerSpectating(playerid,1);
	    		UsingSpawnBar[playerid] = 1;
	    		TextDrawHideForPlayer(playerid, E1);
	    		TextDrawShowForPlayer(playerid, NewbieDraw3);
	    		TextDrawShowForPlayer(playerid, NewbieDraw1[playerid]);
    			TextDrawShowForPlayer(playerid, NewbieDraw2[playerid]);
	    		SpawnSpots(playerid);
	    		SetTimerEx("SpawnBarFix", 2000, false, "i", playerid);
   			 	SendClientMessage(playerid,COLOR_WHITE," ");
	    		SendClientMessage(playerid,COLOR_WHITE,"Press Your fire key to spawn at that location, and sprint key to change location.");
  				}
				else
				{
  				ShowPlayerDialog( playerid, 3, DIALOG_STYLE_LIST, "What is your Gender?", "Male\nFemale\nShemale", "Select", "Cancel" );
		    	TogglePlayerSpectating( playerid, true );
		    	SendClientMessage( playerid, LIGHTBLUE, "Hello there! You're new to our server." );
				}
    			}
				else
				{
   				SendClientMessage( playerid, WHITE, "Incorrect password. Please try again!" );
	    		ShowPlayerDialog( playerid, 1, DIALOG_STYLE_INPUT, "Login / Authentication Process", "Hello there!\n\nPlease enter your password to authenticate.", "Login", "Cancel" );
	    		}
    			}
				else
				{
   				SendClientMessage( playerid, WHITE, "Incorrect password. Please try again!" );
	    		ShowPlayerDialog( playerid, 1, DIALOG_STYLE_INPUT, "Login / Authentication Process", "Hello there!\n\nPlease enter your password to authenticate.", "Login", "Cancel" );
        		}
	    		}
	    case 2:
	    {
	        if( strlen( inputtext ) >= 30 )
	        {
	            ShowPlayerDialog( playerid, 2, DIALOG_STYLE_INPUT, "Registration Process", "Hello there!\n\nPlease enter a password to register.", "Authenticate", "Cancel" );
	            SendClientMessage( playerid, WHITE, "You must use a shorter password - has to be less than 30 characters." );
	        }
	        else
	        {
	            if( strlen( inputtext ) >= 1 )
	            {
	                new EscapedPassword[ 30 ], Query[ 128 ], Name[ MAX_PLAYER_NAME ], EscapedName[ MAX_PLAYER_NAME ];

	                GetPlayerName( playerid, Name, sizeof( Name ) );

	                mysql_real_escape_string( Name, EscapedName );
	                mysql_real_escape_string( inputtext, EscapedPassword );

	                #pragma unused Name

	                format( Query, sizeof( Query ), "INSERT INTO `Accounts` (Username, Password) VALUES('%s', '%s')", EscapedName, EscapedPassword );
	                mysql_query( Query );

	                SendClientMessage( playerid, WHITE, "Now, please login with the password you've just entered to proceed." );
	                InitPlayerConnection( playerid );
	            }
	            else
	            {
	                ShowPlayerDialog( playerid, 2, DIALOG_STYLE_INPUT, "Registration Process", "Hello there!\n\nPlease enter a password to register.", "Authenticate", "Cancel" );
	                SendClientMessage( playerid, WHITE, "Your password must be longer than 1 character..." );
	            }
	        }
	    }