I have this plugin that show me if an entity is breakable. The problem is that it show me the Bomb Site Green Box as breakable but in fact they are breakable just by C4 (and I think the RPG). So.. there is any way to detect only entityes breakable by the player?
Код:
#include <amxmodx>
#include <engine>
#include <reapi>
// Defines
#define AIMTASK 500
// Cvars
new cvar_message_type
public plugin_init()
{
register_plugin("Breakable Hint", "1.1", "Raheem")
// Cvars
cvar_message_type = register_cvar("break_hint_type", "2")
// Tasks
set_task(0.5, "Check_AimTask", AIMTASK, _, _, "b")
}
public Check_AimTask()
{
if (get_pcvar_num(cvar_message_type) == 0)
{
remove_task(AIMTASK, 0)
return
}
for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
{
if (!is_user_alive(id))
continue
new iEntIndex, iBody
get_user_aiming(id, iEntIndex, iBody)
if(is_valid_ent(iEntIndex) && !is_user_connected(iEntIndex))
{
new szClassName[32]
get_entvar(iEntIndex, var_classname, szClassName, charsmax(szClassName))
if(equal(szClassName, "func_breakable"))
{
if (get_pcvar_num(cvar_message_type) == 1)
{
set_hudmessage(random(256), random(256), random(256), 0.1, -0.3, 2, 2.0, 2.0)
show_hudmessage(id, "You can break this entity!")
}
else if (get_pcvar_num(cvar_message_type) == 2)
{
client_print(id, print_center, "You can break this entity!")
}
}
}
}
}