rcon help
#1

Hello can someone help me out I tried to make a filterscript for anti rcon I searched the net but only found this
Код:
#include <a_samp>

forward AfterPlayerConnect(playerid);
forward ChangeRCONPassword();

enum pInfo
{
	bool:SCON
}

new PlayerInfo[MAX_PLAYERS][pInfo];
new pass[20];

#define white 0xFFFFFFFF

public OnFilterScriptInit()
{
	GetServerVarAsString("rcon_password", pass, sizeof(pass));
	SetTimer("ChangeRCONPassword", 2000, 1);
	return 1;
}

public OnFilterScriptExit()
{
	new string[39];
	format(string, sizeof(string), "rcon_password %s", pass);
	SendRconCommand(string);
	return 1;
}

public OnPlayerConnect(playerid)
{
	SetTimerEx("AfterPlayerConnect", 1000, 0, "i", playerid);
	return 1;
}

public AfterPlayerConnect(playerid)
{
	PlayerInfo[playerid][SCON] = false;
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp("/scon login", cmdtext, true, 11) == 0)
	{
		new string[36];
		if(strlen(cmdtext[12]) == 0) return 1;
		format(string, sizeof(string), "/scon login %s", pass);

		if(strcmp(cmdtext, string, true) == 0)
		{
			PlayerInfo[playerid][SCON] = true;
			SendClientMessage(playerid, white, "SCON: You have logged in as admin.");
		}
		return 1;
	}

	if(strcmp("/scon", cmdtext, true, 5) == 0)
	{
		if(strlen(cmdtext[6]) == 0) return 1;
		if(cmdtext[6] == ' ') return 1;

		if(PlayerInfo[playerid][SCON] == true)
		{
			new string[128];
			SendRconCommand(cmdtext[6]);
			format(string, sizeof(string), "SCON: RCON Command \" %s \" sent", cmdtext[6]);
			SendClientMessage(playerid, white, string);
		}
		return 1;
	}
	return 0;
}

public ChangeRCONPassword()
{
	new string[39], password[25];

	new letters[][] =
	{
		"a", "b", "c", "d",
		"e", "f", "g", "h",
		"i", "j", "k", "l",
		"m", "n", "o", "p",
		"q", "r", "s", "t",
		"u", "v", "w", "x",
		"y", "z"
	};

	new bool:numlet = false;

	for(new i = 0; i < 20; i++)
	{
		if(numlet == false)
		{
			new number = random(10);
			format(string, sizeof(string), "%d", number);
			strins(password, string, i, 1);
			numlet = true;
		}
		else if(numlet == true)
		{
			new letter = random(26);
			strins(password, letters[letter], i, 1);
			numlet = false;
		}
	}

	format(string, sizeof(string), "rcon_password %s", password);
	SendRconCommand(string);

	//print(string);
}
but I need a script that would automaticly ban anyone who attempts to login rcon and fails and if the players logins rcon and successed so either you fail or login it just bans you automaticly I know that you can turn off the rcon but I just want it like this can anyone help me make it as a filterscript?
Reply


Messages In This Thread
rcon help - by Chiao - 06.10.2013, 19:11
Re: rcon help - by ic3cr3am - 06.10.2013, 20:05
Re: rcon help - by Chiao - 07.10.2013, 14:14
Re: rcon help - by Konstantinos - 07.10.2013, 14:44

Forum Jump:


Users browsing this thread: 1 Guest(s)