PDA

View Full Version : Entity doesn't trigger Touch


th7nder
10-13-2014, 18:05
Hi guys! I have another problem to solve and hope you will help me with it (;

So, I want to remove an object everytime it hits player/or some element on map, but entity only triggers SDKHook_Touch when entity hits client, not barrel for example.


new rocket = CreateEntityByName("prop_physics_multiplayer");
DispatchKeyValue(rocket, "model", "models/props/de_nuke/crate_large.mdl");
DispatchKeyValue(rocket, "targetname", name);
SetEntProp(rocket, Prop_Data, "m_CollisionGroup", 5);
SetEntityMoveType(rocket, MOVETYPE_FLY);
/// settings of the entity, etc.
SDKHook(rocket, SDKHook_StartTouch, OnEntityCollision);

// function
public OnEntityCollision(entity, other){
PrintToServer("e: %d o: %d", entity, other);
RemoveEdict(entity);
}

Monzy
10-24-2014, 06:17
I have the same problem. And I also asked the same question a while ago i think. No answers, though:cry:. I've tried to figure it out for a while, and i'm not sure it's possible to do as a script in sm. But I'm pretty new to modding, so don't take my word for it.

friagram
10-24-2014, 11:31
Prop physics multiplayer has some spawnflags you need to set to make it always fire touch functions/force serverside. You also have to set it's collisiongroup/solidflags iirc. Some of the freak fortress plugins i have released use them with touch functions, though I dont remember ehich. Probably halloween 2013.