im trying to do noblock projectiles for teammates.
PHP Code:
public void OnEntityCreated(int entity, const char[] classname) {
if (StrEqual(classname, "smokegrenade_projectile", false)) {
SDKHook(entity, SDKHook_StartTouch, OnTouch);
SetEntData(entity, CollisionGroup, 2, 1, true);
}
}
public void OnTouch(int entity, int client) {
int owner = GetEntPropEnt(entity, Prop_Send, "m_hThrower");
if(GetClientTeam(client) != GetClientTeam(owner)) {
int hurt = CreateEntityByName("point_hurt");
AcceptEntityInput(hurt, "TurnOn");
SetEntProp(hurt, Prop_Data, "m_nDamage", 1);
SetEntProp(hurt, Prop_Data, "m_bitsDamageType", DMG_GENERIC);
AcceptEntityInput(hurt, "Hurt", owner);
AcceptEntityInput(hurt, "TurnOff");
}
}
but projectiles pass through enemies. And now i want to simulate hit and ricochet manually.
Any ideas how to make this ?