I search only functions with Ham_Touch... your idea is use RegisterHam(Ham_TakeDamage, "func_tracktrain", ...)?
https://forums.alliedmods.net/showpo...3&postcount=17
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN ""
#define VERSION "0.0.1"
new g_iMaxPlayers
#define IsPlayer(%0) ( 1 <= (%0) <= g_iMaxPlayers )
public plugin_init()
{
register_plugin( PLUGIN, VERSION, "ConnorMcLeod" )
RegisterHam(Ham_Player_PostThink, "func_tracktrain", "OnCBasePlayer_PostThink", false)
g_iMaxPlayers = get_maxplayers()
}
public OnCBasePlayer_PostThink( ent )
{
new target = pev(ent, pev_groundentity) // <-- I found that an entity not have pev_groundentity
if( IsPlayer(target) && is_user_alive(target) )
{
client_print(0, print_chat, "An entity is touching your head")
}
}