Say /country, Show Players Countries

Coding Help/Re-API Supported
Post Reply
User avatar
Null
Member
Member
Saudi Arabia
Posts: 28
Joined: 3 years ago
Location: Saudi Arabia, Riyadh
Contact:

Say /country, Show Players Countries

#1

Post by Null » 3 years ago

HI guys i want when i say /country show me all players countries
with same color see the photo when i say /country what show me
Attachments
de_dust20001.bmp
de_dust20001.bmp (2.93 MiB) Viewed 2698 times
de_dust20001.bmp
de_dust20001.bmp (2.93 MiB) Viewed 2698 times

User avatar
Supremache
Member
Member
Egypt
Posts: 9
Joined: 3 years ago
Contact:

#2

Post by Supremache » 3 years ago

Untested :

Code: Select all

#include <amxmodx>
#include <geoip>

#define PLUGIN "Show Online Players Country"
#define VERSION "1.0"
#define AUTHOR "Supremache"

new szPlayerName[33][32]
new szCountry[45][32]
new szIP[33][32]

new const szCommands[][] =
{
	"say /c",
	"say /country",
	"say_team /c",
	"say_team /country"
}

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	for (new i = 0; i < charsmax(szCommands); i++)
		register_clcmd(szCommands[i], "_Country")
}

public client_putinserver(id)
{
	get_user_name(id, szPlayerName[id], charsmax(szPlayerName[]));
	get_user_ip(id, szIP[id], charsmax(szIP[]));
	geoip_country(szIP[id], szCountry[id], charsmax(szCountry[]));
}

public _Country(id) 
{
	if (!is_user_connected(id))	return PLUGIN_HANDLED;
	
	static TitleMenu[256],
		iPlayers[32],
		iNum;
		
	formatex(TitleMenu,charsmax(TitleMenu),"\yPlayers Country:");
	new iMenu = menu_create(TitleMenu,"_Hundler");
		
	get_players(iPlayers, iNum, "ch");
		
	for(new iPlayer, i = 0; i < iNum; i++) 
	{
		iPlayer = iPlayers[i]
		
		formatex(TitleMenu, charsmax(TitleMenu), "\w%s		\y%s", szPlayerName[iPlayer], szCountry[iPlayer]);
		menu_additem(iMenu, TitleMenu);
	}
	
	menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, iMenu, 0);
	
	return PLUGIN_CONTINUE;
}

public _Hundler(id, iMenu,iItem) 
{
	menu_destroy(iMenu);
	return PLUGIN_CONTINUE;
}


Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 3 guests