Solved
#1

solved
Reply
#2

noone?
Reply
#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
#4

well it doesn't log me in if I enter the wrong password now..
but it also doesn't show the "The password you entered was wrong" message if I enter a wrong pass...
Reply
#5

And it lets you in if you enter the correct password
Reply
#6

yeap
Reply
#7

so what's wrong?
Reply
#8

Код:
if(dialogid == 1){
	if(!response){
 		SendClientMessage(playerid, RED, "Login Canceled!");
		Data[playerid][Level] = 0;
		return 1;
	}else{
		new string[128], pname[MAX_PLAYER_NAME], pas[64];
		GetPlayerName(playerid, pname, sizeof(pname));
		format(pas,sizeof(pas), "idiot");
		if(!strlen(inputtext)) {
			GetPlayerIp(playerid, pas, 16);
			format(string, sizeof(string), "Your entered password (%s) was wrong!", inputtext);
			SendClientMessage(playerid, RED, string);
			format(string, sizeof(string), "@ %s failed on login (%s)! IP: %s", pname, inputtext, pas);
			AdminMessage(CYAN, string);
			Data[playerid][Level] = 0;
			return 1;
		}
		if(strcmp(pas,inputtext,true) != 0){
			GetPlayerIp(playerid, pas, 16);
			format(string, sizeof(string), "Your entered password (%s) was wrong!", inputtext);
			SendClientMessage(playerid, RED, string);
			format(string, sizeof(string), "@ %s failed on login (%s)! IP: %s", pname, inputtext, pas);
			AdminMessage(CYAN, string);
			Data[playerid][Level] = 0;
			return 1;
		}else{
			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);
			}
			return 1;
		}
	}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)