AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   geoip functions (https://forums.alliedmods.net/showthread.php?t=55315)

Evaldas 05-19-2007 09:42

geoip functions
 
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?

sslice 05-19-2007 10:44

Re: geoip functions
 
The extension is implemented, but currently, none of the plugins use it.

Evaldas 05-19-2007 18:22

Re: geoip functions
 
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);

}


BAILOPAN 05-19-2007 18:33

Re: geoip functions
 
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.


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

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