#include <amxmodx>
#include <geoip>
#include <reapi>

#define PLUGIN "GirisYapti"
#define VERSION "2.0"
#define AUTHOR "By.KinG"

new const TAG[] = "Yolo Gaming";

new const OyunaGirdiSesi[] = "buttons/bell1";

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);

	register_dictionary("GirisYapti.txt");
}

public client_putinserver(id)
{
	if(!is_user_bot(id) && !is_user_hltv(id))
	{
		set_task(5.0, "OyunaGirisYapti", id);
	}
}

public OyunaGirisYapti(id)
{
	new Name[MAX_CLIENTS+1];
	get_user_name(id, Name, 32);
	
	static IP[16];
	static Country[45];
	
	get_user_ip(id, IP, charsmax(IP), 1);
	geoip_country_ex(IP, Country, charsmax(Country));
	
	if(containi(Country, "Turkey") != -1)
	{
		formatex(Country, charsmax(Country), "Turkiye");
	}
	
	if(get_user_flags(id) & ADMIN_RESERVATION)
	{
		if(is_user_steam(id))
		{
			client_print_color(0, 0, "%L", LANG_PLAYER, "STEAM_ADMIN", TAG, Name, Country);
		}
		else
		{
			client_print_color(0, 0, "%L", LANG_PLAYER, "NORMAL_ADMIN", TAG, Name, Country);
		}
	}
	else if(is_user_steam(id))
	{
		client_print_color(0, 0, "%L", LANG_PLAYER, "STEAM_USER", TAG, Name, Country);
	}
	else
	{
		client_print_color(0, 0, "%L", LANG_PLAYER, "NORMAL_USER", TAG, Name, Country);
	}
	
	client_cmd(id, "spk ^"sound/%s^"", OyunaGirdiSesi);
}