Raised This Month: $ Target: $400
 0% 

Solved Country Wrong


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 06-29-2019 , 12:03   Country Wrong
Reply With Quote #1

I do not know why this shows that I connect from GER and I do not from GER.
Would you like someone to check if the code is correct or requires a change?
PHP Code:
#include < amxmodx >
#include < geoip >
#include < colorchat>

#define IsUserAdmin(%1) ( get_user_flags( %1 ) & ADMIN_KICK )

public plugin_init( ) {
    
register_plugin"Connect Announcer""1.0""xPaw" );
    
    
register_messageget_user_msgid"TextMsg" ), "MessageTextMsg" );
}

public 
client_putinserverid )
    
ShowClientMessageid"has connected" );
public 
client_disconnectid )
    
ShowClientMessageid"has disconnected" );

public 
MessageTextMsg( const iMsgId, const iMsgDest, const id ) {
    new 
szMsg17 ];
    
get_msg_arg_string2szMsg16 );
    
    if( 
equalszMsg"#Game_connected" ) ) {
        new 
szIP16 ], szCountry46 ];
        
get_user_ipidszIP15);
    
        if( 
szIP] == 'l' // loopback
            
get_user_ip0szIP15);
        
        
geoip_countryszIPszCountry45 );
        
        if( 
szCountry] == 'e' && szCountry] == 'r' && szCountry] == 'o' )
            return;
        
        new 
szMsg80 ];
        
formatexszMsg79"%%s has connected from %s.^n"szCountry );
        
        
set_msg_arg_string2szMsg );
    }
}
ShowClientMessage( const id, const szAction[ ] ) {
    new 
szNick32 ], szIP16 ], szCode], szCountry46 ];
    
get_user_nameidszNick31 );
    
get_user_ipidszIP15);
    
    if( 
szIP] == 'l' // loopback
        
get_user_ip0szIP15);
    
    if( !
geoip_code2_exszIPszCode ) ) {
        
szCode] = '-';
        
szCode] = '-';
    }
    
    
geoip_countryszIPszCountry45 );
    
    if( 
szCountry] == 'e' && szCountry] == 'r' && szCountry] == 'o' )
        
szCountry "Unknown Country";
    
    
ColorChat0NORMAL"^4[PerfectList]^3 %s^4 %s^1 %s. [ %s ]^4 %s^1."IsUserAdminid ) ? "Admin" "Player"szNickszActionszCodeszCountry );

how can i change the settask show after 3 second of player join

Last edited by Fuck For Fun; 07-03-2019 at 16:04.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 06-29-2019 , 12:13   Re: Country Wrong
Reply With Quote #2

That's how your IP is listed in the GeoIP database. You can try updating the mmdb file with the one in AMXX 1.9.
Otherwise, you'd need to add a check and replace with the correct country manually.
__________________
<VeCo> is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 06-29-2019 , 12:30   Re: Country Wrong
Reply With Quote #3

Quote:
Originally Posted by <VeCo> View Post
That's how your IP is listed in the GeoIP database. You can try updating the mmdb file with the one in AMXX 1.9.
Otherwise, you'd need to add a check and replace with the correct country manually.
before i posting i update my GEOIP AND Country data and nothing change
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-29-2019 , 15:19   Re: Country Wrong
Reply With Quote #4

It's not the plugin's fault and you're probably not the only one. It would be rather undoable to check every single IP address and assign the correct country to it.
__________________

Last edited by OciXCrom; 06-29-2019 at 15:24.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 06-29-2019 , 16:56   Re: Country Wrong
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
It's not the plugin's fault and you're probably not the only one. It would be rather undoable to check every single IP address and assign the correct country to it.
Good to know this from you, will I be happy for more data or help?
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
thEsp
BANNED
Join Date: Aug 2017
Old 06-29-2019 , 17:01   Re: Country Wrong
Reply With Quote #6

IIRC this happened to me randomly also, but I updated the GeoIP.dat file since it was using some kind of an old "version".

Last edited by thEsp; 06-29-2019 at 17:01.
thEsp is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 07-02-2019 , 16:40   Re: Country Wrong
Reply With Quote #7

Quote:
Originally Posted by thEsp View Post
IIRC this happened to me randomly also, but I updated the GeoIP.dat file since it was using some kind of an old "version".
Link of geoip.dat? i can't find it
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Old 07-02-2019, 16:55
thEsp
This message has been deleted by thEsp.
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 07-02-2019 , 17:37   Re: Country Wrong
Reply With Quote #9

I'd suggest to use GeoIP+ which is included in 1.9.0

https://dev.maxmind.com/geoip/geoip2/geolite2/

These are the kindof an official databases which are updated once every week.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 07-03-2019 , 16:04   Re: Country Wrong
Reply With Quote #10

Quote:
Originally Posted by thEsp View Post
https://www.upload.ee/files/10165789/GeoIP.dat.html
This is the one I've used within AMXX and worked just fine since the one already included in geoip module is "wrong" or "outdated", IIRC.
Quote:
Originally Posted by SomewhereLost View Post
I'd suggest to use GeoIP+ which is included in 1.9.0

https://dev.maxmind.com/geoip/geoip2/geolite2/

These are the kindof an official databases which are updated once every week.
thanks, solved
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
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 17:17.


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