Hey there,
is there any way to check, if player is looking at FSOLID_NOT_SOLID entity?
I use this filter:
Code:
stock int getClientViewEntity(int client) {
float m_vecOrigin[3];
float m_angRotation[3];
GetClientEyePosition(client, m_vecOrigin);
GetClientEyeAngles(client, m_angRotation);
Handle tr = TR_TraceRayFilterEx(m_vecOrigin, m_angRotation, MASK_ALL, RayType_Infinite, TRDontHitSelf, client);
int pEntity = -1;
if (TR_DidHit(tr)) {
pEntity = TR_GetEntityIndex(tr);
PrintToChatAll("GOT HIT %i", pEntity);
delete tr;
if (!IsValidEntity(pEntity))
return -1;
return pEntity;
}
delete tr;
return -1;
}
stock bool TRDontHitSelf(int entity, int mask, any data) {
if (entity == data)
return false;
return true;
}
but it detects only solid entities.