Code:
bool:user_can_see_head(client, victim)
{
if( !is_user_alive(client) || !is_user_alive(victim) ) return false;
static Float:client_head[3];
static Float:victim_head[3];
static Float:angles[3];
engfunc(EngFunc_GetBonePosition, client, 8, client_head, angles);
engfunc(EngFunc_GetBonePosition, victim, 8, victim_head, angles);
engfunc(EngFunc_TraceLine, client_head, victim_head, DONT_IGNORE_MONSTERS, client, 0);
return (get_tr2(0, TR_pHit) == victim);
}
__________________