Remove TAB Players Country please

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Remove TAB Players Country please

Мнение от Infamous2018 » 23 Юни 2018, 17:57

Hello, can anyone edit the Plugin for me? It should show Country only in Chat when they add an message like :

[DE] Swarm Hunter: Hello

At the moment its showing in TAB too. Can anyone remove it in TAB there? It would be cool and fine. THX

Код за потвърждение: Избери целия код

new const PLUGIN[ ] = "Country On Name"
new const VERSION[ ] = "1.0.1";
new const AUTHOR[ ] = "Bboy Grun";
new const g_unknow[ ] = "[??]";
new const g_lan[ ] = "[LAN]";
new const g_privateAddress[ ][ ] = { "10.0", "172.16", "192.168", "loopback" };

#define WITHOUT_PORT	1

#include < amxmodx >
#include < geoip >

new g_country[ 33 ][ 6 ];

new g_pCvar_botTag, g_pCvar_lanTag;

public plugin_init( ) 
{
	register_plugin( PLUGIN, VERSION, AUTHOR );
	
	set_pcvar_string( register_cvar( "country_on_name", VERSION, FCVAR_SERVER | FCVAR_SPONLY ), VERSION );
	
	g_pCvar_botTag = register_cvar( "bot_tag", "0" );
	g_pCvar_lanTag = register_cvar( "lan_tag", "0" );
}

public client_putinserver( id )
{
	new ip[ 16 ], country[ 3 ];
	get_user_ip( id, ip, charsmax( ip ), WITHOUT_PORT ); // Get player IP
	
	if( geoip_code2_ex( ip, country ) )
	{
		format( g_country[ id ], charsmax( g_country[ ] ), "[%s]", country ); // Player country detected
	}
	else
	{
		if( is_user_bot( id ) ) // player is a bot, let's set a special tag
		{
			switch( get_pcvar_num( g_pCvar_botTag ) )
			{
				case 0: // Show [??]
				{
					g_country[ id ] = g_unknow;
				}
				case 1: // Show [BOT]
				{
					g_country[ id ] = "[BOT]";
				}
				case 2: // Show [LAN]
				{
					g_country[ id ] = g_lan;
				}
			}
		}
		else
		{
			if( get_pcvar_num( g_pCvar_lanTag ) ) // check for lan ?
			{
				new i;
				
				for( i = 3; i > -1; i -- )
				{
					if( contain( ip, g_privateAddress[ i ] ) > -1 )
					{
						g_country[ id ] = g_lan;
						break;
					}
				}
				
				if( i == -1 )
				{
					g_country[ id ] = g_unknow;
				}
			}
			else
			{
				g_country[ id ] = g_unknow;
			}
		}
	}
}

public client_disconnect( id )
{
	g_country[ id ][ 0 ] = EOS;
}

public client_infochanged( id )
{
	if( g_country[ id ][ 0 ] )
	{
		new name[ 32 ];
		get_user_info( id, "name", name, charsmax( name ) );
		
		for( new i = 0; i <= 4; i ++ )
		{
			if( name[ i ] != g_country[ id ][ i ] && g_country[ id ][ i ] )
			{
				format( name, charsmax( name ), "%s %s", g_country[ id ], name );
				set_user_info( id, "name", name );
				return PLUGIN_HANDLED;
			}
		}
	}
		
	return PLUGIN_CONTINUE;
}

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Remove TAB Players Country please

Мнение от OciXCrom » 23 Юни 2018, 19:48

No, because this plugin changes the player's name in order to show the country. If the name is changed, it will display it in tab too. You'll need a plugin that adds the country prefix in the chat only rather than changing the player's name. I suggest you use my plugin - https://forums.alliedmods.net/showthread.php?t=297952

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: Bing [Bot] и 6 госта