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);
}
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);
}