Try this
PHP Code:
#include <sdktools>
#include <sdkhooks>
#define COLLISION_GROUP_DEBRIS 1 // trigger not work
#define COLLISION_GROUP_DEBRIS_TRIGGER 2
#define COLLISION_GROUP_WEAPON 11
public void OnPluginStart()
{
HookEvent("chest_respawn", chest);
}
public void OnEntityCreated(int entity, const char[] classname)
{
if(StrEqual(classname, "weapon_chest", false))
SDKHook(entity, SDKHook_SpawnPost, SpawnPost);
}
public void SpawnPost(int entity)
{
int ref = EntIndexToEntRef(entity);
if(ref != -1)
RequestFrame(delay, ref);
}
public void chest(Event event, const char[] name, bool dontBroadcast)
{
int entity = event.GetInt("chestid");
int ref = EntIndexToEntRef(entity);
if(ref != -1)
RequestFrame(delay, ref);
}
public void delay(any data)
{
SetCollisionGroup(data, COLLISION_GROUP_DEBRIS_TRIGGER);
}
void SetCollisionGroup(int ref, int collisionGroup)
{
if(IsValidEntity(ref) && IsValidEdict(ref))
{
SetEntProp(ref, Prop_Send, "m_CollisionGroup", collisionGroup);
//PrintToServer("SetCollisionGroup %i", ref);
}
}
...those chests, what spawn on top of small pilar. Pilar have higher colllision box what block player, chest itself can lay top of pilar. If you wonder.
__________________