yep. Show your code next time...
*I quick tested in cs:go tough...
PHP Code:
#include <sdktools>
// ---------------------------
// Hit Group standards
// ---------------------------
#define HITGROUP_GENERIC 0
#define HITGROUP_HEAD 1
#define HITGROUP_CHEST 2
#define HITGROUP_STOMACH 3
#define HITGROUP_LEFTARM 4
#define HITGROUP_RIGHTARM 5
#define HITGROUP_LEFTLEG 6
#define HITGROUP_RIGHTLEG 7
#define HITGROUP_GEAR 10 // alerts NPC, but doesn't do damage or bleed (1/100th damage)
public void OnPluginStart()
{
RegConsoleCmd("sm_test", test);
}
public Action test(int client, int args)
{
float eyespos[3];
GetClientEyePosition(client, eyespos);
float eyesang[3];
GetClientEyeAngles(client, eyesang);
Handle Ray = TR_TraceRayFilterEx(eyespos, eyesang, MASK_SHOT, RayType_Infinite, filter, client);
int index = TR_GetEntityIndex(Ray);
int hitgroup = TR_GetHitGroup(Ray);
if(index > 0 && hitgroup == HITGROUP_HEAD)
PrintToServer("%N HitBoxIndex %i HitGroup %i", index, TR_GetHitBoxIndex(Ray), hitgroup);
delete Ray;
return Plugin_Handled;
}
public bool filter(int entity, int contentsMask, any data)
{
// Don't look yourself, only client indexes
if(entity != data && entity > 0 && entity <= MaxClients) return true;
return false;
}