Solved
#3

Код:
if(dialogid == 1)
{
	if(response == 0)
	{
		SendClientMessage(playerid, RED, "Login Canceled!");
		Data[playerid][Level] = 0;
		return 1;
	}
	
	else if(response == 1)
	{
		new string[128], pname[MAX_PLAYER_NAME], pas[128], epas[128];
		GetPlayerName(playerid, pname, sizeof(pname));
		
		format(pas,sizeof(pas), "idiot");
		format(epas, sizeof(epas), "%s", inputtext);
		
		if(!strlen(inputtext))
		{
			new string1[256], ip[256];
			GetPlayerIp(playerid, ip, sizeof(ip));

			format(string1, sizeof(string1), "@ %s failed on login (%s)! IP: %s", pname, inputtext, ip);
			format(string, sizeof(string), "Your entered password (%s) was wrong!", inputtext);
			SendClientMessage(playerid, RED, string);
			AdminMessage(CYAN, string1);
			Data[playerid][Level] = 0;
			return 1;
		}
		
		if(strcmp(epas,pas)==1) //NOTE:If it let's you in with wrong password, try changing 1 to 0
		{
			new string1[256], ip[256];
			GetPlayerIp(playerid, ip, sizeof(ip));

			format(string1, sizeof(string1), "@ %s failed on login (%s)! IP: %s", pname, inputtext, ip);
			format(string, sizeof(string), "Your entered password (%s) was wrong!", inputtext);
			SendClientMessage(playerid, RED, string);
			AdminMessage(CYAN, string1);
			Data[playerid][Level] = 0;
			return 1;
		}
		if(!strcmp(epas,pas)) //and the opposite here
		{
			new pName[50]; GetPlayerName(playerid, pName, 50);
			if(!strcmp(pName, "lol", true) || !strcmp(pName, "haha", true))
			{
				SendClientMessage(playerid, GREEN, "You are logged in as Admin and Manager now!");

				format(string, sizeof(string), "System: EventManager %s logged in!", pname);
				SendClientMessageToAll(GREEN, string);
				Data[playerid][Level] = 2;
				SetPlayerColor(playerid, LIGHTBLUE);
			}
			else
			{
				SendClientMessage(playerid, GREEN, "You are logged in as Admin now!");
				format(string, sizeof(string), "System: %s logged in!", pname);
				SendClientMessageToAll(GREEN, string);
				Data[playerid][Level] = 1;
				SetPlayerColor(playerid, WHITE);
			}
		}
	}
}
Reply


Messages In This Thread
Solved - by Sascha - 19.06.2010, 18:37
Re: Problem with Dialog...Please help - by Sascha - 20.06.2010, 07:41
Re: Problem with Dialog...Please help - by DJDhan - 20.06.2010, 08:13
Re: Problem with Dialog...Please help - by Sascha - 20.06.2010, 08:33
Re: Problem with Dialog...Please help - by DJDhan - 20.06.2010, 08:44
Re: Problem with Dialog...Please help - by Sascha - 20.06.2010, 09:48
Re: Problem with Dialog...Please help - by Sascha - 20.06.2010, 13:31
Re: Problem with Dialog...Please help - by Jefff - 20.06.2010, 14:59

Forum Jump:


Users browsing this thread: 1 Guest(s)