I'm trying to get prop_physics entities in a short radius from the player by using a TraceHull, but for some reason the TraceHull never finds anything even if I set the mins and maxs to a ridiculously high amount. The TR_GetEntityIndex is always returning 0.
Code:
public bool:IncludeProp(entity, contentsMask) {
new String:EntClass[32];
GetEntityClassname(entity, EntClass, 32);
return (StrContains(EntClass, "prop_physics") == 0);
}
Code:
new Float:plyPos[3];
GetClientEyePosition(client, plyPos);
new Handle:NearbyEnts = TR_TraceHullFilterEx(plyPos, plyPos, {-415.0, -415.0, -415.0}, {415.0, 415.0, 415.0}, MASK_PLAYERSOLID, IncludeProp);
if (TR_DidHit(NearbyEnts)) {
int prop = TR_GetEntityIndex(NearbyEnts);
if (prop > 0) {
PrintToChat(client, "Test");
}
}