Raised This Month: $12 Target: $400
 3% 

country filter (working again)


Post New Thread Reply   
 
Thread Tools Display Modes
izakamakazi
Junior Member
Join Date: Nov 2009
Location: Wales
Old 12-30-2009 , 13:25   Re: country filter (working again)
Reply With Quote #61

To anyone that has had problems stopping the console announcing the infected, here is the link to a post where Antithasys modifies the script made by Mikestoolz and compiles it for us.

https://forums.alliedmods.net/showthread.php?t=113791

Thanks again Antithasys! your a saviour.
izakamakazi is offline
Send a message via MSN to izakamakazi
rautamiekka
Veteran Member
Join Date: Jan 2009
Location: Finland
Old 01-25-2010 , 10:25   Re: country filter (working again)
Reply With Quote #62

Uhm, why the Plugin Dev ain't making his stuff work ? Instead outsiders are doing that.

I'd also like a whitelist feature which supports SteamIDs.
__________________
Links to posts I received Karma from:
Big thanks to all who gave Karma
rautamiekka is offline
Send a message via ICQ to rautamiekka Send a message via AIM to rautamiekka Send a message via MSN to rautamiekka Send a message via Yahoo to rautamiekka Send a message via Skype™ to rautamiekka
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-27-2010 , 02:30   Re: country filter (working again)
Reply With Quote #63

Latest FTP direction to GeoIP.dat.gz
http://geolite.maxmind.com/download/...eoLiteCountry/
(I have try/rename GeoIPv6.dat and ofcourse it' not work wrong versio)

How update GeoIP.dat to Sourcemod ?
I assume you have MetaModSource & SourceMod
- First unzip *.gz packet GeoIP.dat (Use WinRAR or something else IZArc)
- Now let's update it that we don't shut down server... type this command to srcds.exe: meta list
- Find sourcemod "list number" and type command to srcds.exe: meta unload number
(Unload SM because it use GeoIP.dat file all the time, can't replace/overwrite new GeoIP.dat)

- You can update ...addons\sourcemod\configs\geoip\GeoIP.dat
(Hint & Tip: "Backup" rename old GeoIP.dat example -GeoIP.dat before you update new one.
If some problems appears so you can easily fix back)

- And final, reboot server
Bacardi is offline
Havock
Junior Member
Join Date: Apr 2009
Old 01-30-2010 , 03:21   Re: country filter (working again)
Reply With Quote #64

hi, what to do with this

Code:
L 01/30/2010 - 14:03:03: [SM] Native "KickClient" reported: Client 13 is not connected
L 01/30/2010 - 14:03:03: [SM] Displaying call stack trace for plugin "country_filter.smx":
L 01/30/2010 - 14:03:03: [SM]   [0]  Line 100, D:\game\PRO_jECT\CSS\sourcemod-1.3.0\addons\sourcemod\scripting\country_filter.sp::cfTimer()
I'm a little bit modified the plugin
Code:
#include <sourcemod>
#include <geoip>

#define PLUGIN_VERSION "1.1.1"

new Handle:cf_mode;
new Handle:cf_countries;
new Handle:cf_reject_msg;
new String:country[45];

public Plugin:myinfo =
{
	name = "Country Filter",
	author = "Knagg0",
	description = "",
	version = PLUGIN_VERSION,
	url = "http://www.mfzb.de"
};

public OnPluginStart()
{
	CreateConVar("cf_version", PLUGIN_VERSION, "", FCVAR_PLUGIN | FCVAR_REPLICATED | FCVAR_NOTIFY);
	cf_mode = CreateConVar("cf_mode", "1", "", FCVAR_PLUGIN);
	cf_countries = CreateConVar("cf_countries", "", "", FCVAR_PLUGIN);
	cf_reject_msg = CreateConVar("cf_reject_msg", "Your country (%s) isn't allowed on this server", "", FCVAR_PLUGIN);
}

public bool:OnClientConnect(client, String:rejectmsg[], maxlen)
{
	new String:ip[16];
	new String:code2[3];

	GetClientIP(client, ip, sizeof(ip));
	GeoipCode2(ip, code2);
	GeoipCountry(ip, country, sizeof(country));
 
	if ((StrEqual(country, "")) && (StrContains(ip, "172.16.")== 0  || StrContains(ip, "172.17.")== 0))
	{ 
		country= "Local";
	} 
	if(Reject(code2))
	{
		CreateTimer(0.1, cfTimer, client);
		return false;
	}
	
	new String:name[32];
	GetClientName(client, name, 32);
	PrintToChatAll("\x04 %s:\x03 %s %s",name ,country ,ip);
	
	return true;
}

public bool:Reject(const String:code2[])
{
	if(StrEqual("", code2))
		return false;
		
	new String:str[255];
	new String:arr[100][3];
	
	GetConVarString(cf_countries, str, 255);
	
	new total = ExplodeString(str, " ", arr, 100, 3);
	if(total == 0) strcopy(arr[total++], 3, str);
	
	if(GetConVarInt(cf_mode) == 2)
	{
		for(new i = 0; i < total; i++)
		{
			if(StrEqual(arr[i], code2))
				return true;
		}
	}
	else
	{
		new bool:reject = true;
		
		for(new i = 0; i < total; i++)
		{
			if(StrEqual(arr[i], code2))
				reject = false;
		}
		
		return reject;
	}

	return false;
}

public Action:cfTimer(Handle:timer, any:client)
{
	new String:rejectmsg[255];
	GetConVarString(cf_reject_msg, rejectmsg, 255);
	Format(rejectmsg, 255, rejectmsg, country);
	KickClient(client, rejectmsg);
}
Havock is offline
Havock
Junior Member
Join Date: Apr 2009
Old 01-31-2010 , 12:36   Re: country filter (working again)
Reply With Quote #65

i think whis code good if Native "KickClient" reported: Client 13 is not connected, but need edit this plugin
Code:
public Action:cfTimer(Handle:timer, any:client)
{
	if(IsClientInGame(client))
		KickClient(client, "%t", "Reject visit http://sait.ru", country);
}
del:
Code:
new Handle:cf_reject_msg;
cf_reject_msg = CreateConVar("cf_reject_msg", "Your country (%s) isn't allowed on this server", "", FCVAR_PLUGIN);
right ?
Havock is offline
Zesi
Junior Member
Join Date: Dec 2007
Old 04-30-2010 , 16:46   Re: country filter (working again)
Reply With Quote #66

hi guys.

is there a way to hide the connect-messages in l4d2 ? every time i see the tank/hunter/boomer......... spawn. thats to easy.

Greetz
Zesi is offline
Lucker
Junior Member
Join Date: Dec 2009
Old 06-04-2010 , 15:40   Re: country filter (working again)
Reply With Quote #67

Hello, I have install the plugin from the first post but wehn is map change crash the server give it a fixxed version?

I have an Counter Strike: Source Gameserver platform Linux Debian

SourceMod Error Log:

Quote:
L 06/04/2010 - 1536: [SM] Native "KickClient" reported: Client 11 is not connected
L 06/04/2010 - 1536: [SM] Displaying call stack trace for plugin "country_filter.smx":
L 06/04/2010 - 1536: [SM] [0] Line 101, /home/groups/alliedmodders/forums/files/2/7/2/5/3/23782.attach::cfTimer()
L 06/04/2010 - 1536: [SM] Native "KickClient" reported: Client 1 is not connected
L 06/04/2010 - 1536: [SM] Displaying call stack trace for plugin "country_filter.smx":
L 06/04/2010 - 1536: [SM] [0] Line 101, /home/groups/alliedmodders/forums/files/2/7/2/5/3/23782.attach::cfTimer()
L 06/04/2010 - 1536: Error log file session closed.
L 06/04/2010 - 1536: SourceMod error session started
L 06/04/2010 - 1536: Info (map "mg_random_weapons") (file "errors_20100604.log")
L 06/04/2010 - 1536: [SM] Unable to load plugin "autoload_dukehacks.smx": Required extension "Dukehacks Extension" file("dukehacks.ext") not running
L 06/04/2010 - 153:48: SourceMod error session started
L 06/04/2010 - 153:48: Info (map "mg_hellz_multigame_fix") (file "errors_20100604.log")

Last edited by Lucker; 06-04-2010 at 15:46.
Lucker is offline
Send a message via ICQ to Lucker
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 06-05-2010 , 11:11   Re: country filter (working again)
Reply With Quote #68

Lucker, you have also other plugin given error that it need extension.
Maybe that crash server after mapchange.

Plugin = autoload_dukehacks.smx
Need extension = dukehacks.ext
[EXTENSION] Dukehacks

You can try first, remove that plugin autoload_dukehacks.smx
in disabled folder and reboot server.
Check wil it crash again ??
Then you can be sure which one of plugins cause this issue.

But try fix that.
Bacardi is offline
checkster
BANNED
Join Date: Apr 2007
Location: Norway
Old 07-01-2010 , 02:35   Re: country filter (working again)
Reply With Quote #69

Will adding this automaticly create a cfg ?
Or do I edit somewhere else ?

Hope you understand that one.

Regards checkster
checkster is offline
rautamiekka
Veteran Member
Join Date: Jan 2009
Location: Finland
Old 07-01-2010 , 06:13   Re: country filter (working again)
Reply With Quote #70

Quote:
Originally Posted by checkster View Post
Will adding this automaticly create a cfg ?
Or do I edit somewhere else ?

Hope you understand that one.

Regards checkster
I really doubt it auto-creating the config, but even if it does, you'll be best off by adding the CVars to the bottom of
Code:
/cfg/sourcemod/sourcemod.cfg
__________________
Links to posts I received Karma from:
Big thanks to all who gave Karma
rautamiekka is offline
Send a message via ICQ to rautamiekka Send a message via AIM to rautamiekka Send a message via MSN to rautamiekka Send a message via Yahoo to rautamiekka Send a message via Skype™ to rautamiekka
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode