Code:
enum SolidType_t {
SOLID_NONE = 0, //no solid model
SOLID_BSP = 1, //a BSP tree
SOLID_BBOX = 2, //an AABB
SOLID_OBB = 3, //an OBB (not implemented yet)
SOLID_OBB_YAW = 4, //an OBB,constrained so that it can only yaw
SOLID_CUSTOM = 5, //always call into the entity for tests
SOLID_VPHYSICS = 6, //solid vphysics object,get vcollide from the model and collide with that
SOLID_LAST,
}
new g_iOffs_MoveType = FindSendPropInfo("CDynamicProp","movetype")
new g_iOffs_nSolidType = FindSendPropInfo("CDynamicProp","m_nSolidType")
new g_iOffs_nSkin = g_iOffs_nSkin = FindSendPropInfo("CDynamicProp","m_nSkin")
new g_iOffs_nRenderMode = FindSendPropInfo("CDynamicProp","m_nRenderMode")
new g_iOffs_clrRender = FindSendPropInfo("CDynamicProp","m_clrRender")
new ent = CreateEntityByName("prop_dynamic_override")
if(ent != -1) {
SetEntityModel(ent,g_szModelList[model])
DispatchSpawn(ent)
DispatchKeyValue(ent,"classname","bms_block")
SetEntData(ent,g_iOffs_MoveType,_:MOVETYPE_NONE,1,true)
SetEntData(ent,g_iOffs_nSolidType,_:SOLID_BBOX,1,true)
SetEntData(ent,g_iOffs_nSkin,_:type,1,true)
SetEntData(ent,g_iOffs_nRenderMode,0,1,true)
SetEntData(ent,g_iOffs_clrRender,color[0],1,true)
SetEntData(ent,g_iOffs_clrRender + 1,color[1],1,true)
SetEntData(ent,g_iOffs_clrRender + 2,color[2],1,true)
SetEntData(ent,g_iOffs_clrRender + 3,color[3],1,true)
TeleportEntity(entity, spawn_location, NULL_VECTOR, NULL_VECTOR);
}