STRING* HitBoneName = str_create("");
///
var dist = c_trace(whatever);
if(dist>0) //make sure something WAS hit
{ if(hit.entity!=NULL); //make sure we have an ENTITY
{ ent_bonename(hit.entity, HitBoneName, hit.vertex); //get the bone name
if(str_len(HitBoneName)>0) //make sure a BONE has been hit
{ //"HitBoneName" is the name of the bone we've hit.
//and if you name them simple like L_Arm_0, L_Arm_1, R_Arm_0, R_Arm_1, etc
//they'll be easy to spot with
if(str_cmpni(HitBoneName,"L_Arm_")==1)
{ //some part of LEFT ARM was hit }
else if(str_cmpni(HitBoneName,"R_Arm_")==1)
{ //some part of RIGHT ARM was hit }
else if(str_cmpni(HitBoneName,"L_Leg_")==1)
{ //some part of LEFT LEG was hit }
else if(str_cmpni(HitBoneName,"R_Leg_")==1)
{ //some part of RIGHT LEG was hit }
}
else
{
//entity has been hit but no bone is assigned to that vertex
}
}
else
{
//there was a hit but NOT an entity
}
}
else
{
//NOTHING was hit
}