/* 本插件由 AMXX-Studio 中文版自动生成*/
/* UTF-8 func by www.DT-Club.net */

#include <amxmodx>
#include "metahook.inc"
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <amxmisc>

#define PLUGIN_NAME	"BTE NONE MOD HELP"
#define PLUGIN_VERSION	"1.0"
#define PLUGIN_AUTHOR	"BTE TEAM"

#define BOMB_TARGET_TYPE1 "func_bomb_target" 
#define BOMB_TARGET_TYPE2 "info_bomb_target"


new vecBomb[2][3],g_EntitySum
public plugin_init()
{
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
	server_cmd("bte_wpn_free 0")
	server_cmd("bte_wpn_buyzone 1")
}

public plugin_cfg()
{
	new cfgdir[32]
	get_configsdir(cfgdir, charsmax(cfgdir))
	
	
	server_cmd("exec %s/%s", cfgdir, "bte_originmod.cfg")


	new entity = -1, Float:tmpOrigin[3]

	// BOMB_TARGET_TYPE1
	while ((entity = find_ent_by_class(entity, BOMB_TARGET_TYPE1)))
	{
		get_brush_entity_origin(entity, tmpOrigin)
		FVecIVec(tmpOrigin, vecBomb[g_EntitySum])

		g_EntitySum++
	}

	// BOMB_TARGET_TYPE2
	entity = -1
	while ((entity = find_ent_by_class(entity, BOMB_TARGET_TYPE2)))
	{
		entity_get_vector(entity,EV_VEC_origin,tmpOrigin)
		FVecIVec(tmpOrigin, vecBomb[g_EntitySum])

		g_EntitySum++
	}
}
public client_putinserver(id)
{
	set_task(3.0,"Check",id)
}
public Check(id)
{
	if(MH_IsMetaHookPlayer(id)) 
	{
		MH_SendClientModRunning(id,1)
		if(g_EntitySum)
		{
			MH_DrawFollowIcon(id,"bte_bombtargetA",vecBomb[0][0],vecBomb[0][1],vecBomb[0][2],1,1,1,200,200,200)
		}
		if(g_EntitySum>1)
		{
			MH_DrawFollowIcon(id,"bte_bombtargetB",vecBomb[1][0],vecBomb[1][1],vecBomb[1][2],1,1,2,200,200,200)
		}
	}
}

	
		
		
		
		
