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

geoip functions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Evaldas
Member
Join Date: Jul 2005
Location: Lithuania
Old 05-19-2007 , 09:42   geoip functions
Reply With Quote #1

I haven't found anything about SourceMod & GeoIP. Found “geoip.ext.so”, but I haven’t found a dat file. So.. is geoip already included or it is only in “to do” list?
__________________
Evaldas is offline
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 05-19-2007 , 10:44   Re: geoip functions
Reply With Quote #2

The extension is implemented, but currently, none of the plugins use it.
__________________
sslice is offline
Evaldas
Member
Join Date: Jul 2005
Location: Lithuania
Old 05-19-2007 , 18:22   Re: geoip functions
Reply With Quote #3

hmm.., looks like i've found something. Let's say, if I would like to test it. The code should be that?

Code:
#include <sourcemod>
#include <console>
#include <geoip>

public Plugin:myinfo = 
{
	name = "IP Loger",
	author = "Evaldas",
	description = "TEST",
	version = "0.0.0.2",
	url = "http://www.lemita.eu/"
};

public OnClientPutInServer(client) {

	new String:authid[64];
	new String:name[32];
	new String:ipaddr[17];
	new String:country[3];

	GetClientAuthString(client, authid, 63);
	GetClientName(client, name, sizeof(name));
	GetClientIP(client, ipaddr, 16);
	GeoipCode2(ipaddr, country);

	LogToGame(" %s , %d , %s , %s", name, ipaddr, country, authid); 

}
__________________
Evaldas is offline
BAILOPAN
Join Date: Jan 2004
Old 05-19-2007 , 18:33   Re: geoip functions
Reply With Quote #4

Yes. You can be a little more consistent:

Code:
    GetClientAuthString(client, authid, sizeof(authid));     GetClientName(client, name, sizeof(name));     GetClientIP(client, ipaddr, sizeof(ipaddr));

Note there is no reason to subtract 1 for sizes.
__________________
egg
BAILOPAN is offline
Reply


Thread Tools
Display Modes

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 08:34.


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