AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Country Wrong (https://forums.alliedmods.net/showthread.php?t=317146)

Fuck For Fun 06-29-2019 12:03

Country Wrong
 
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

<VeCo> 06-29-2019 12:13

Re: Country Wrong
 
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.

Fuck For Fun 06-29-2019 12:30

Re: Country Wrong
 
Quote:

Originally Posted by <VeCo> (Post 2657144)
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

OciXCrom 06-29-2019 15:19

Re: Country Wrong
 
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.

Fuck For Fun 06-29-2019 16:56

Re: Country Wrong
 
Quote:

Originally Posted by OciXCrom (Post 2657173)
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?

thEsp 06-29-2019 17:01

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

Fuck For Fun 07-02-2019 16:40

Re: Country Wrong
 
Quote:

Originally Posted by thEsp (Post 2657199)
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

SomewhereLost 07-02-2019 17:37

Re: Country Wrong
 
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.

OciXCrom 07-02-2019 20:02

Re: Country Wrong
 
GeoIP got updated in a recent 1.9 build, so I suggest you simply update to the latest one.

Fuck For Fun 07-03-2019 16:04

Re: Country Wrong
 
Quote:

Originally Posted by thEsp (Post 2657517)
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 (Post 2657522)
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


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

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