I'm trying to add the tf_bot engineer behaviour to players, where they can walk through their own buildings as if they were teammates.
So far I've tried to use SDKHook_ShouldCollide to false, as well as true, and that only changes whether or not the wrench can hit the sentry.
I've looked in to the prop m_CollisionGroup but not entirely sure what this can accomplish.
I am able to hook the sentry under the correct circumstance, I just can't make it behave like a friendly building without changing the owner, which is not an optimal solution.
Snippet:
PHP Code:
SDKHook(client, SDKHook_Touch, OnTouch);
if (StrEqual(entname, "obj_sentrygun") || StrEqual(entname, "obj_dispenser"))
{
int iBuilder = GetEntPropEnt(ent, Prop_Send, "m_hBuilder");
if (client == iBuilder){
//Here I need to somehow set the logic so the iBuilder can walk through these two ent names on touch.
SetEntProp(ent, Prop_Send, "m_CollisionGroup", 18);
SDKHook(client, SDKHook_ShouldCollide, ShouldCollide);
}
}
public bool ShouldCollide(entity, collisiongroup, contentmask, bool result)
{
return false;
}
__________________