Raised This Month: $66 Target: $400
 16% 

Player Location 0.7b


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   EKS (167)
anson_wongy
Junior Member
Join Date: Jul 2005
Old 08-04-2005 , 07:48   Player Location 0.7b
Reply With Quote #1

This plugin will let u know where ppl come from.
And auto kick player with in one of two modes.

Command:
amx_showloc <@CT, @T , @ALL or nick>(Or leave blank for showing all players)

It will reply like this:
(Team display mode)
Code:
Location info of players: 
=================================
ID | Name | Ping | Loss | IP | Location | Code
1 | 008DEADinHK | 20 | 0 | 221.127.239.177 | Hong Kong | HK
2 | player A | 25 | 0 | 221.126.141.165 | Hong Kong | HK
3 | player B | 33 | 0 | 218.254.195.87 | Hong Kong | HK
4 | player C | 107 | 3 | 221.215.105.66 | China | CN
5 | player D | 99 | 1 | 61.231.107.107 | Taiwan | TW
=================================
Total player listed: 5 players
========================
(Single player)
Code:
Here is some info of : Sprite | 008DEADinHK
=================================
ID: 1
Ping: 20
Loss: 0
IP: 221.127.239.177
Location: Hong Kong
Code: HK
=========================
CVars:
amx_loc_kick_mode 0 - Auto kick mode (0 = off, 1 = kick players whose country code is amx_loc_kick_code, 2 = kick players whose country code is **NOT** amx_loc_kick_code)

amx_loc_kick_code "" - GeoIP *TWO* dgit code (list of codes are listed in a text file included in the package)

amx_loc_access 2 - Who can access amx_showloc (0 = No one, 1 = All players, 2 = Admin only)

====================================
GeoIP module **REQUIRED**

How to enable GeoIP module?
Open modules.ini, remove the semicolons before:
Code:
;geoip_amxx_i386.so
;geoip_amxx.dll
;geoip_amxx_amd64.so
like this:
Code:
geoip_amxx_i386.so
geoip_amxx.dll
geoip_amxx_amd64.so
Then, save ur files and restart ur server, that's all!
Attached Files
File Type: txt codes.txt (12.6 KB, 2349 views)
File Type: sma Get Plugin or Get Source (player_location.sma - 3594 views - 6.7 KB)
File Type: zip player_location_075b.zip (14.2 KB, 2479 views)
anson_wongy is offline
D_Hawk
Veteran Member
Join Date: Apr 2005
Location: No
Old 08-04-2005 , 12:59  
Reply With Quote #2

Good job, installing this right now.
__________________
User has abandoned this account.
D_Hawk is offline
Send a message via ICQ to D_Hawk Send a message via AIM to D_Hawk Send a message via MSN to D_Hawk Send a message via Yahoo to D_Hawk
Blitz
Senior Member
Join Date: Jul 2005
Location: Google
Old 08-04-2005 , 15:00  
Reply With Quote #3

Sweet Plugin...
Good job.
__________________
[img]http://img268.**************/img268/7071/blitz4ek.jpg[/img]

In the beginning, God created the search button.
Blitz is offline
gudbjorn
New Member
Join Date: Dec 2005
Location: in the deep sea
Old 12-26-2005 , 07:16   Re: Player Location 0.7b
Reply With Quote #4

Quote:
Originally Posted by anson_wongy
This plugin will let u know where ppl come from.
And auto kick player with in one of two modes.

Command:
amx_showloc <@CT, @T , @ALL or nick>(Or leave blank for showing all players)

It will reply like this:
(Team display mode)
Code:
Location info of players: 
=================================
ID | Name | Ping | Loss | IP | Location | Code
1 | 008DEADinHK | 20 | 0 | 221.127.239.177 | Hong Kong | HK
2 | player A | 25 | 0 | 221.126.141.165 | Hong Kong | HK
3 | player B | 33 | 0 | 218.254.195.87 | Hong Kong | HK
4 | player C | 107 | 3 | 221.215.105.66 | China | CN
5 | player D | 99 | 1 | 61.231.107.107 | Taiwan | TW
=================================
Total player listed: 5 players
========================
(Single player)
Code:
Here is some info of : Sprite | 008DEADinHK
=================================
ID: 1
Ping: 20
Loss: 0
IP: 221.127.239.177
Location: Hong Kong
Code: HK
=========================
CVars:
amx_loc_kick_mode 0 - Auto kick mode (0 = off, 1 = kick players whose country code is amx_loc_kick_code, 2 = kick players whose country code is **NOT** amx_loc_kick_code)

amx_loc_kick_code "" - GeoIP *TWO* dgit code (list of codes are listed in a text file included in the package)

amx_loc_access 2 - Who can access amx_showloc (0 = No one, 1 = All players, 2 = Admin only)

====================================
GeoIP module **REQUIRED**

How to enable GeoIP module?
Open modules.ini, remove the semicolons before:
Code:
;geoip_amxx_i386.so
;geoip_amxx.dll
;geoip_amxx_amd64.so
like this:
Code:
geoip_amxx_i386.so
geoip_amxx.dll
geoip_amxx_amd64.so
Then, save ur files and restart ur server, that's all!
gudbjorn is offline
badboyz
Member
Join Date: Dec 2005
Location: East Brunswick NJ
Old 12-26-2005 , 20:42  
Reply With Quote #5

Great Plugin! Going on my server right now! Ill let you know if theres a problem or not.
__________________

Warcraft3 FT -=oG=- Clan
69.248.82.68:27016

-=oG=- Normal Server ~Tryout~
69.248.82.68:27023
-=oG=- Clan Website
badboyz is offline
Send a message via AIM to badboyz Send a message via MSN to badboyz
jimmy_cr
Member
Join Date: Sep 2004
Old 01-09-2006 , 04:01  
Reply With Quote #6

Great Plugin!!

I remade it to use more than one "code" - just write them to /configs/country.ini
every code on separate line

here's my code
Code:
//* AMX Mod X - Player Location Plugin
* 
* by 008DEADinHK (anson_wongy)
* 
* Website: XGamerHK.Com - http://xgamerhk.com - PLAY GAME BECAUSE GAME
* Forum: http://forum.xgamerhk.com
* E-Mail: [email protected] or [email protected]
* 
* şŻ: XGamerHK.Com - http://xgamerhk.com - ąCŔˇEąCŔ
* ˝ľ: http://forum.xgamerhk.com
* E-Mail: [email protected] or [email protected]
* 
* Any question? Visit XGamerrHK Forum! http://forum.xgamerhk.com/
* łĂD? ĹwŞďě XGAmerHK Forum o! http://forum.xgamerhk.com/
* 
* WARNING!: GeoIP module **REQUIRED** for this plugin.
* Ş`N!: ąˇĄ/Ą~ľ*n GeoIP ĽŇ˛Ő.
*
* This plugin has been tested on AMXModX 1.01 successfully.
* 
* CVars:
* amx_loc_kick_mode 0 - Auto kick mode
* (0 = off, 1 = kick players whose country code is amx_loc_kick_code, 2 = kick players whose country code is **NOT** amx_loc_kick_code)
* 
* amx_loc_access 2 - Players who can access amx_showloc (0 = disabled, 1 = All players, 2 = Admin only)
* 
****************************************************************************
* 
*   This program is free software; you can redistribute it and/or
*   modify it under the terms of the GNU General Public License
*   as published by the Free Software Foundation; either version 2
*   of the License, or (at your option) any later version.
*
*   This program is distributed in the hope that it will be useful,
*   but WITHOUT ANY WARRANTY; without even the implied warranty of
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*   GNU General Public License for more details.
*
*   You should have received a copy of the GNU General Public License
*   along with this program; if not, write to the Free Software
*   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
* 
****************************************************************************
*/

#include <amxmodx>
#include <amxmisc>
#include <geoip>

new configsdir[200]
new configfile[200]
new country[255][2]
new totalcountries; 


public plugin_init() {
	register_plugin("Player Location", "0.7b", "008DEADinHK (anson_wongy)")
	
	register_cvar("amx_loc_kick_mode", "0")
	register_cvar("amx_loc_access", "2")
	
	new showloc_access[2]
	get_cvar_string("amx_loc_access", showloc_access, 1)
	
	if (!equali(showloc_access, "0")) {
		if (!equali(showloc_access, "1")) {
			register_concmd("amx_showloc", "show_playerlocation", ADMIN_KICK, "<target> - @ALL, @CT, @T, playername")
		} else if (!equali(showloc_access, "2")) {
			register_concmd("amx_showloc", "show_playerlocation", -1, "<target> - @ALL, @CT, @T, playername")
		}
	}
	Load_File()
	Read_File()
}

public kickplayer(id) {
	new Reason[64]
	format(Reason, 63, "Player from your country/area isnt allowed to join this server.")
	server_cmd("kick #%d ^"%s^"", get_user_userid(id), Reason)
}

public client_authorized(id) {
	new kick_mode[2]
	new found
	new i
	get_cvar_string("amx_loc_kick_mode", kick_mode, 1)
	
	if (!equali(kick_mode, "0")) {
		new playerip[16], geoip_code[3], kick_code[3]
		get_user_ip(id, playerip, 15, 1)		
		if (!equali(playerip, "127.0.0.1")) {

	    		if (equali(kick_mode, "1")) {
				found = 0
			}
        		if (equali(kick_mode, "2")) {
				found = 1
			}

//			log_message("found set to %d", found)

			for(i = 0 ;i < totalcountries; ++i) {

				geoip_code2(playerip, geoip_code)

				kick_code = country[i+1]

//				new uname[33]
//				get_user_name(id,uname,32)

				if (equali(kick_mode, "1")) {
					if (equali(geoip_code[0], kick_code[0])) {
//						log_message("Player %s NOT approved to connect - %s", uname, geoip_code[0])
						found = 1
					}
				} else if (equali(kick_mode, "2")) {  
					if (equali(geoip_code[0], kick_code[0])) {
//						log_message("Player %s approved to connect - %s", uname, geoip_code[0])
						found = 0
					}
				}
			}

			if (found==1) {
				kickplayer(id)
			}
		}
	}	
	return PLUGIN_HANDLED
}

public show_playerlocation(id, level, cid) {
	if (!cmd_access(id,level,cid,1)) 
		return PLUGIN_HANDLED
	
	new Arg1[24]
	read_argv(1, Arg1, 23)
	
	if (equali(Arg1, "")) {
		format(Arg1, 24, "@ALL")
	}
		
	new playername[32], playerping, playerloss, playerip[16], playerloc[46], playerloccode[3]
	if (Arg1[0] == '@')
	{
		new Team = 0
		if (equali(Arg1[1], "CT")) {
			Team = 2
		} else if (equali(Arg1[1], "T")) {
			Team = 1
          	} else if (equali(Arg1[1], "ALL")) {
          		Team = 0
          	} else {
          		Team = 0
          	}
          	new players[32], num, i
		get_players(players, num)
		
		
		console_print(id, "Location info of players: ")
		console_print(id, "=================================")
		console_print(id, "ID | Name | Ping | Loss | IP | Location | Code")
		
		new playernum		
		for (i=0; i<num; i++)
		{
			if (!Team)
			{				
				get_user_name(players[i], playername, 31)
				get_user_ip(players[i], playerip, 15, 1)
				get_user_ping(players[i], playerping, playerloss)
				if (!equali(playerip, "127.0.0.1")) {
					geoip_country(playerip, playerloc, 45)
					geoip_code2(playerip, playerloccode)
				} else {
					format(playerloc, 45, "localhost (unknown)")
					format(playerloccode, 2, "")
				}
				
				console_print(id, "%d | %s | %d | %d | %s | %s | %s", players[i], playername, playerping, playerloss, playerip, playerloc, playerloccode)
				playernum++
			} else {
				if (get_user_team(players[i]) == Team)
				{
					get_user_name(players[i], playername, 31)
					get_user_ip(players[i], playerip, 15, 1)
					get_user_ping(players[i], playerping, playerloss)
					if (!equali(playerip, "127.0.0.1")) {
						geoip_country(playerip, playerloc, 45)
						geoip_code2(playerip, playerloccode)
					} else {
						format(playerloc, 45, "localhost (unknown)")
						format(playerloccode, 2, "")
					}
					console_print(id, "%d | %s | %d | %d | %s | %s | %s", players[i], playername, playerping, playerloss, playerip, playerloc, playerloccode)
					playernum++					
				}
			}
		}
		
		console_print(id, "=================================")
		console_print(id, "Total player listed: %d players", playernum)
		console_print(id, "=================================")
	} else {
		new player = cmd_target(id, Arg1, 2)
		if (!player)
		{
			console_print(id, "Sorry, player %s could not be found or targetted!", Arg1)
			return PLUGIN_HANDLED
		} else {
			get_user_name(player, playername, 31)
			get_user_ip(player, playerip, 15, 1)
			get_user_ping(player, playerping, playerloss)
			
			if (!equali(playerip, "127.0.0.1")) {
				geoip_country(playerip, playerloc, 45)
				geoip_code2(playerip, playerloccode)
			} else {
				format(playerloc, 45, "localhost (unknown)")
				format(playerloccode, 2, "")
			}
			
			console_print(id, "Here is some info of : %s", playername)
			console_print(id, "=================================")
			console_print(id, "ID: %d", player)
			console_print(id, "Ping: %d", playerping)
			console_print(id, "Loss: %d", playerloss)
			console_print(id, "IP: %s", playerip)
			console_print(id, "Location: %s", playerloc)
			console_print(id, "Code: %s", playerloccode)
			console_print(id, "=================================")
		}
	}
	return PLUGIN_HANDLED
}

public Load_File()
{
    get_configsdir(configsdir,63);
    
    format(configfile,63,"%s/country.ini",configsdir);
    
    if(!file_exists(configfile))
    {
        write_file(configfile,"CZ",0);
    }
}

public Read_File()
{
    new data[3][36],line,lnstr[256],len;
    totalcountries=0
    while(read_file(configfile,line++,data[0],255,len))
    {
        if(lnstr[0] == ';' || !len)
        {
            continue;
        }
        copyc(country[line],19,data[0],'.')
        totalcountries++;
    }
}
edit: repaired some code
jimmy_cr is offline
Send a message via ICQ to jimmy_cr
Rilley
Junior Member
Join Date: Aug 2007
Old 10-14-2007 , 09:28   Re: Player Location 0.7b
Reply With Quote #7

hy jimmy_cr, or somebody.. how can i make jimmy_cr`s EDIT to work .. like this -a new .INI (in amxmodx/configs/) were you can add some ISP`s(like 192.168.*! or 10.0. * classes of ip ) who can join to the server even the palyer_location is config.. for RO or ,, USA.. (ps: sorry for my bad english )
Rilley is offline
Krillin
Senior Member
Join Date: Jul 2004
Old 12-11-2008 , 15:35   Re: Player Location 0.7b
Reply With Quote #8

Quote:
Originally Posted by anson_wongy View Post
====================================
GeoIP module **REQUIRED**

How to enable GeoIP module?
Open modules.ini, remove the semicolons before:
Code:
;geoip_amxx_i386.so
;geoip_amxx.dll
;geoip_amxx_amd64.so
like this:
Code:
geoip_amxx_i386.so
geoip_amxx.dll
geoip_amxx_amd64.so
Then, save ur files and restart ur server, that's all!
Lunix operators should be aware not to enable both .SO files on their servers.
like this:
Code:
;Enable below for x86 (32bit) builds
geoip_amxx_i386.so
;Enable below for windows builds
;geoip_amxx.dll 
;Enable below for a64 (64bit) builds
;geoip_amxx_amd64.so
Enabling both of these on Linux could cause conflicts, security issues and crashes. So know exactly what you are working with before playing with these settings. 64 bit support was removed with version AMXX 1.8 so typically x86 should be used.

From what has been read and absorbed one should never enable what is never used therefore x86 should never have a a64 module running if not in use.

I hope this clears this clears up any confusion.

Also, not useful on connecting to server hosted in a LAN environment. Needs code to allow non-routeable IP addresses.

Quote:
Originally Posted by Network Working Group
Reference Page
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
Sincerely,
Krillin
__________________
Krillin's World Server(s) Operator


Last edited by Krillin; 12-11-2008 at 17:52. Reason: Unable to connect to LAN Server (non-routable ip address)
Krillin is offline
Send a message via Yahoo to Krillin
ObiPCPP
Junior Member
Join Date: Apr 2009
Old 04-12-2009 , 21:49   Re: Player Location 0.7b
Reply With Quote #9

Does this still work and will it lag my server (TF2 server within Australia which I would like locked to AU and NZ players only)?
ObiPCPP is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 04-09-2010 , 09:48   Re: Player Location 0.7b
Reply With Quote #10

is it possible to hide admin's location? So no one could see where the admin from, but still was able to see each other's location.
Marchello is offline
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 23:17.


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