Raised This Month: $ Target: $400
 0% 

[HELP] use geoip to display city


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 12-18-2015 , 19:47   Re: [HELP] use geoip to display city
Reply With Quote #1

Quote:
Originally Posted by arvEL. View Post
i added it, but not work!!
not display country or city :/
I do not have time to test it, but if geoip_city(...) is not working, open a issue at Issues with AMX Mod X

Hence, start reading that sub-forum rules: FORUM RULES: Read before you post

But observe:
Quote:
Originally Posted by https://www.amxmodx.org/api/geoip/geoip_city
Return

The result length on successful lookup, 0 otherwise.
Checks its return length size, then use that city as Unknown. This is because, do not exists every words cities at that data base by an IP.

Learn first intent the code and next to give some empty lines and spacing.

Code:
#include <amxmodx> #include <geoip> #include <colorchat>   public plugin_init() {     register_plugin( "Join Country", "1.0", "<VeCo>" ) } public client_putinserver( id ) {     static sz_name[32]     get_user_name( id, sz_name, charsmax( sz_name ) )     static sz_ip[32],     sz_city[32],     sz_country[32]     get_user_ip( id, sz_ip, charsmax( sz_ip ), 1 )     geoip_country( sz_ip, sz_country, charsmax( sz_country ) )         if( !geoip_city( sz_ip, sz_city, charsmax( sz_city ) ) )     {         copy( sz_city, charsmax( sz_city ), "Unknown" )     }     ColorChat( 0, GREY, "^1Player^4 %s^1 from^3 %s/%s^1 has joined the game!", sz_name, sz_country, sz_city ) }

However, GHW Connect Messages is a plugin that is working for me at that server specs I showed earlier.

Update:

Quote:
Originally Posted by arvEL. View Post
i added it, but not work!!
not display country or city :/
Quote:
Originally Posted by addons_zz View Post
It is not crashing mime. What you are using? (meta list, geoip version, version)
Quote:
If you have access to your game server's console, type the following in the server console:
  • status
  • meta list
  • geoip version
  • version
If you don't have access the your game server's console, join your server and type the
following in your game console:
  • status
  • rcon_password your_rcon_password
  • rcon meta list
  • rcon geoip version
  • rcon version
  1. Paste here everything from the status command *except* the player list.
  2. Paste here the entire result from the meta list, geoip version and version commands.

Last edited by addons_zz; 12-18-2015 at 21:10. Reason: spelling fixes and new better info
addons_zz is offline
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 12-19-2015 , 04:27   Re: [HELP] use geoip to display city
Reply With Quote #2

Quote:
Originally Posted by addons_zz View Post
I do not have time to test it, but if geoip_city(...) is not working, open a issue at Issues with AMX Mod X

Hence, start reading that sub-forum rules: FORUM RULES: Read before you post

But observe:


Checks its return length size, then use that city as Unknown. This is because, do not exists every words cities at that data base by an IP.

Learn first intent the code and next to give some empty lines and spacing.

Code:
#include <amxmodx> #include <geoip> #include <colorchat> public plugin_init() { register_plugin( "Join Country", "1.0", "<VeCo>" ) } public client_putinserver( id ) { static sz_name[32] get_user_name( id, sz_name, charsmax( sz_name ) ) static sz_ip[32], sz_city[32], sz_country[32] get_user_ip( id, sz_ip, charsmax( sz_ip ), 1 ) geoip_country( sz_ip, sz_country, charsmax( sz_country ) ) if( !geoip_city( sz_ip, sz_city, charsmax( sz_city ) ) ) { copy( sz_city, charsmax( sz_city ), "Unknown" ) } ColorChat( 0, GREY, "^1Player^4 %s^1 from^3 %s/%s^1 has joined the game!", sz_name, sz_country, sz_city ) }


However, GHW Connect Messages is a plugin that is working for me at that server specs I showed earlier.

Update:
i tired from test plugins :/ no one work and GHW_Connect_Message
this display just country no city
__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
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 18:12.


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