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

[ Help ] GeoLite2-City


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 06-20-2018 , 15:14   [ Help ] GeoLite2-City
Reply With Quote #1

if i upload - GeoLite2-City.mmdb
and update all geoip, why player connect is show City: Burgas wrong location? but the player from Varna

Code:
#include <geoip> 
szCity[21]
geoip_city(szIP, szCity, charsmax(szCity))
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-20-2018 , 17:18   Re: [ Help ] GeoLite2-City
Reply With Quote #2

Because that's how correct the internet provider is. Nothing to do with the plugin.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 06-20-2018 , 17:29   Re: [ Help ] GeoLite2-City
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Because that's how correct the internet provider is. Nothing to do with the plugin.
oh okay, and if the city: none shown?

there is not way to do something?
Code:
	get_user_ip(id, szIP, charsmax(szIP))
	geoip_country(szIP, szCountry, charsmax(szCountry)) 
	geoip_city(szIP, szCity, charsmax(szCity))
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-20-2018 , 21:44   Re: [ Help ] GeoLite2-City
Reply With Quote #4

It doesn't have anything to do with the plugin. It depends on the player's IP address.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 06-21-2018 , 04:22   Re: [ Help ] GeoLite2-City
Reply With Quote #5

you can try to use sxgeo module, and use this plugin, or based on it!

PHP Code:
#include <amxmodx>
#include <sxgeo>

#if (AMXX_VERSION_NUM < 183) || defined NO_NATIVE_COLORCHAT
    #include <colorchat>
#else
    #define DontChange print_team_default
    #define client_disconnect client_disconnected
#endif

#pragma semicolon 1

new const PREFIX[]        = "^4[SxGeo]";
new const 
CONNECT_SOUND[] = "buttons/blip1.wav";

new 
g_pcvar_amx_language;

public 
plugin_init()
{
    
register_plugin("[SxGeo] Connect Info""1.0""s1lent");
    
register_dictionary("sxgeo_connect_info.txt");

    
g_pcvar_amx_language get_cvar_pointer("amx_language");
}

public 
client_putinserver(id)
{
    new 
szLanguage[3];
    
get_pcvar_string(g_pcvar_amx_languageszLanguagecharsmax(szLanguage));

    new 
szName[32], szIP[16];
    
get_user_name(idszNamecharsmax(szName));
    
get_user_ip(idszIPcharsmax(szIP), /*strip port*/ 0);

    new 
szCountry[64], szRegion[64], szCity[64];

    new 
bool:bCountryFound sxgeo_country(szIPszCountrycharsmax(szCountry), /*use lang server*/ szLanguage);
    new 
bool:bRegionFound  sxgeo_region (szIPszRegion,  charsmax(szRegion),  /*use lang server*/ szLanguage);
    new 
bool:bCityFound    sxgeo_city   (szIPszCity,    charsmax(szCity),    /*use lang server*/ szLanguage);

    if (
bCountryFound && bCityFound && bRegionFound)
    {
        
client_print_color(0DontChange"%s %L %L^3 %s ^4(%s, %s)"PREFIXLANG_SERVER"CINFO_JOINED"szNameLANG_SERVER"CINFO_FROM"szCityszRegionszCountry);
    }
    else if (
bCountryFound && bRegionFound)
    {
        
client_print_color(0DontChange"%s %L %L^3 %s ^4(%s)"PREFIXLANG_SERVER"CINFO_JOINED"szNameLANG_SERVER"CINFO_FROM"szRegionszCountry);
    }
    else if (
bCountryFound)
    {
        
client_print_color(0DontChange"%s %L %L^4 %s"PREFIXLANG_SERVER"CINFO_JOINED"szNameLANG_SERVER"CINFO_FROM"szCountry);
    }
    else
    {
        
// we don't know where you are :(
        
client_print_color(0DontChange"%s %L^4 ..."PREFIXLANG_SERVER"CINFO_JOINED"szName);
    }

    
client_cmd(0"spk %s"CONNECT_SOUND);

tarsisd2 is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 06-21-2018 , 08:56   Re: [ Help ] GeoLite2-City
Reply With Quote #6

Quote:
Originally Posted by tarsisd2 View Post
you can try to use sxgeo module, and use this plugin, or based on it!

PHP Code:
#include <amxmodx>
#include <sxgeo>

#if (AMXX_VERSION_NUM < 183) || defined NO_NATIVE_COLORCHAT
    #include <colorchat>
#else
    #define DontChange print_team_default
    #define client_disconnect client_disconnected
#endif

#pragma semicolon 1

new const PREFIX[]        = "^4[SxGeo]";
new const 
CONNECT_SOUND[] = "buttons/blip1.wav";

new 
g_pcvar_amx_language;

public 
plugin_init()
{
    
register_plugin("[SxGeo] Connect Info""1.0""s1lent");
    
register_dictionary("sxgeo_connect_info.txt");

    
g_pcvar_amx_language get_cvar_pointer("amx_language");
}

public 
client_putinserver(id)
{
    new 
szLanguage[3];
    
get_pcvar_string(g_pcvar_amx_languageszLanguagecharsmax(szLanguage));

    new 
szName[32], szIP[16];
    
get_user_name(idszNamecharsmax(szName));
    
get_user_ip(idszIPcharsmax(szIP), /*strip port*/ 0);

    new 
szCountry[64], szRegion[64], szCity[64];

    new 
bool:bCountryFound sxgeo_country(szIPszCountrycharsmax(szCountry), /*use lang server*/ szLanguage);
    new 
bool:bRegionFound  sxgeo_region (szIPszRegion,  charsmax(szRegion),  /*use lang server*/ szLanguage);
    new 
bool:bCityFound    sxgeo_city   (szIPszCity,    charsmax(szCity),    /*use lang server*/ szLanguage);

    if (
bCountryFound && bCityFound && bRegionFound)
    {
        
client_print_color(0DontChange"%s %L %L^3 %s ^4(%s, %s)"PREFIXLANG_SERVER"CINFO_JOINED"szNameLANG_SERVER"CINFO_FROM"szCityszRegionszCountry);
    }
    else if (
bCountryFound && bRegionFound)
    {
        
client_print_color(0DontChange"%s %L %L^3 %s ^4(%s)"PREFIXLANG_SERVER"CINFO_JOINED"szNameLANG_SERVER"CINFO_FROM"szRegionszCountry);
    }
    else if (
bCountryFound)
    {
        
client_print_color(0DontChange"%s %L %L^4 %s"PREFIXLANG_SERVER"CINFO_JOINED"szNameLANG_SERVER"CINFO_FROM"szCountry);
    }
    else
    {
        
// we don't know where you are :(
        
client_print_color(0DontChange"%s %L^4 ..."PREFIXLANG_SERVER"CINFO_JOINED"szName);
    }

    
client_cmd(0"spk %s"CONNECT_SOUND);

I read a little about the sxgeo but i cant find the include... is wrong include there is only SxGeoCity, it's based on the same FUNC as GEOIP there is almost no difference

Last edited by Fuck For Fun; 06-21-2018 at 09:04.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
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 12:53.


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