SA-MP Forums Archive
[LOGIN HELP] You can login with any password - 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: [LOGIN HELP] You can login with any password (/showthread.php?tid=355479)



[LOGIN HELP] You can login with any password - Spookie98 - 30.06.2012

Hey guys ! I got a big problem, when somebody logins, he can enter any password and he we`ll be spawned, can you help me ? Here are the Login lines :



Код:
	else if(dialogid == 2) // Login
	{
	    if(response)
	    {
   			new file[64], password[256], IP[16], password2[256];
			format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
			format(password, sizeof(password), "%s", dini_Get(file, "Password"));
			if(strcmp(password, inputtext, true ) && strcmp(password, password2, true ) )
			{
				SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}Invalid password.");
			    ShowDialog(playerid, 2);
			    return 1;
			}
			if(dini_Int(file, "AdminAccount") == 1)
			{
			    SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You can't login directly from an admin account.");
			    Kick(playerid);
			    return 1;
			}
			else if(sscanf(inputtext, "s[128]", inputtext))
			{
			    SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You must enter a password to procceed.");
			    ShowDialog(playerid, 2);
			    return 1;
			}
			else
			{
			    SendClientMessage(playerid, COLOR_LIME, "");
			    SendClientMessage(playerid, COLOR_LIME, "");
			    SendClientMessage(playerid, COLOR_LIME, "");
			    SendClientMessage(playerid, COLOR_LIME, "");
			    SendClientMessage(playerid, COLOR_LIME, "");
			    SendClientMessage(playerid, COLOR_LIME, "");
			    SendClientMessage(playerid, COLOR_LIME, "");
			    SendClientMessage(playerid, COLOR_LIME, "");
			    SendClientMessage(playerid, COLOR_LIME, "");
			    SendClientMessage(playerid, COLOR_LIME, "");
			    format(PlayerInfo[playerid][pIP], 16, "%s", dini_Get(file, "IP"));
				GetPlayerIp(playerid, IP, sizeof(IP));
				dini_Set(file, "IP", IP);
				PlayerInfo[playerid][pGender] = dini_Int(file, "Gender");
				PlayerInfo[playerid][pAge] = dini_Int(file, "Age");
				if(!PlayerInfo[playerid][pGender] || !PlayerInfo[playerid][pAge])
				{
				    ShowDialog(playerid, 3);
				}
				else
				{
        			LoadChar(playerid);
				    SpawnPlayer(playerid);
				}
			}
	    }
	    else
	    {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You have chosen to quit the server.");
	        Kick(playerid);
	    }
	}