TE EXPLODEMODEL

From Sven Co-op
Jump to navigation Jump to search

Spawns multiple rotating models with gravity, collisions, particle trails, and flashing orange lights.

TE_EXPLODEMODEL
void te_explodemodel(Vector pos, float velocity, 
	string model="models/hgibs.mdl", uint16 count=8, uint8 life=32,
	NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
{
	NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
	m.WriteByte(TE_EXPLODEMODEL);
	m.WriteCoord(pos.x);
	m.WriteCoord(pos.y);
	m.WriteCoord(pos.z);
	m.WriteCoord(velocity);
	m.WriteShort(g_EngineFuncs.ModelIndex(model));
	m.WriteShort(count);
	m.WriteByte(life);
	m.End();
}
  • Vector pos Center point for the effect
  • float velocity Ejection speed for all models
  • string model Model to display
  • uint16 count Number of models to spawn
  • uint8 life Time to display all models (seconds * 0.1)