Raised This Month: $ Target: $400
 0% 

Look Up GeoIP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FireJinTW
Senior Member
Join Date: Jan 2012
Old 07-27-2015 , 09:27   Look Up GeoIP
Reply With Quote #1

How can I get this code working again? It seem error compile now with new geoip.inc from here: https://forums.alliedmods.net/showthread.php?t=95665

Thanks

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <geoip>

new AUTHOR[]="T-z3P"
new VERSION[]="0.1"
new PLUGIN[]="AMXX IP"

public plugin_init()
{
    
register_plugin(PLUGIN,VERSION,AUTHOR)
    
register_concmd("amx_ip""cmdIp"ADMIN_KICK"<nick or #userid> : Retreive info about player")
}

public 
cmdIp(id)
{
    if(!(
get_user_flags(id) & ADMIN_KICK)) 
        return 
PLUGIN_HANDLED
        
    
new arg[32]
    
read_argv(1,arg,31)
    new 
target cmd_target(id,arg,CMDTARGET_NO_BOTS)
    
    if(!
target)
        return 
PLUGIN_HANDLED
        
    
new name[32]
    new 
ip[16]
    new 
Country[45]
    new 
City[45]
    new 
Region[4]
    new 
RegionName[45]
    new 
Code2[3]
    new 
Code3[4]
    new 
TimeZone[45]
    new 
ContinentCode[3]
    new 
Continent:CCode
        
    get_user_name
(targetname31)
    
get_user_ip(targetip151)
    
geoip_country(ipCountrycharsmax(Country))
    
geoip_city(ipCitycharsmax(City))
    
geoip_region(ipRegion )
    
geoip_region_name(ipRegionNamecharsmax(RegionName))
    
geoip_code2_ex(ipCode2)
    
geoip_code3_ex(ipCode3)
    
geoip_timezone(ipTimeZonecharsmax(TimeZone))
    
CCode geoip_continent_code(ipContinentCode)
    
    
console_print(id," ")
    
console_print(id," %s's Info"name)
    
console_print(id,"----------------------------------------")
    
console_print(id," Country = %s"Country)
    
console_print(id," City = %s"City)
    
console_print(id," Region = %s"Region)
    
console_print(id," RegionName = %s"RegionName)
    
console_print(id," Code2 = %s"Code2 )
    
console_print(id," Code3 = %s"Code3 )
    
console_print(id," TimeZone = %s"TimeZone)
    
console_print(id," ContinentCode = %s (%d)"ContinentCodeCCode)
    
console_print(id," Latitude = %f"geoip_latitude(ip))
    
console_print(id," Longitude = %f"geoip_longitude(ip))
    
console_print(id," ")
    
    return 
PLUGIN_HANDLED

FireJinTW is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-27-2015 , 19:36   Re: Look Up GeoIP
Reply With Quote #2

What's the error? What version of AMXX are you trying to compile it with?
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-28-2015 , 05:08   Re: Look Up GeoIP
Reply With Quote #3

Try:

geoip_region(ip, Region )

->

geoip_region_code(ip, Region, charsmax(Region))
__________________
Arkshine is offline
FireJinTW
Senior Member
Join Date: Jan 2012
Old 07-28-2015 , 10:04   Re: Look Up GeoIP
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
Try:

geoip_region(ip, Region )

->

geoip_region_code(ip, Region, charsmax(Region))
PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

C
:\Users\csearth\Desktop\AMX Mod X\amxxstudio\addons\amxmodx\scripting\include\geoip.inc(66) : warning 207unknown #pragma
C:\Users\csearth\Desktop\AMX Mod X\amxxstudio\addons\amxmodx\scripting\include\geoip.inc(66) : error 038extra characters on line
C
:\Users\csearth\Desktop\AMX Mod X\amxxstudio\addons\amxmodx\scripting\include\geoip.inc(81) : warning 207unknown #pragma
C:\Users\csearth\Desktop\AMX Mod X\amxxstudio\addons\amxmodx\scripting\include\geoip.inc(81) : error 038extra characters on line
C
:\Users\csearth\Desktop\AMX Mod X\amxxstudio\addons\amxmodx\scripting\include\geoip.inc(94) : warning 207unknown #pragma
C:\Users\csearth\Desktop\AMX Mod X\amxxstudio\addons\amxmodx\scripting\include\geoip.inc(94) : error 038extra characters on line

3 Errors

I got this error with geoip.inc in that update one.
FireJinTW is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-28-2015 , 14:12   Re: Look Up GeoIP
Reply With Quote #5

Forgot to update the .inc to support 1.8.2 properly. In the .inc, find any #pragma and comment the line or remove them.
__________________
Arkshine is offline
FireJinTW
Senior Member
Join Date: Jan 2012
Old 07-28-2015 , 19:42   Re: Look Up GeoIP
Reply With Quote #6

Quote:
Originally Posted by Arkshine View Post
Forgot to update the .inc to support 1.8.2 properly. In the .inc, find any #pragma and comment the line or remove them.
It is working great now.
Thank you very much
FireJinTW is offline
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 00:05.


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