Skip to content

TE_MODEL

GeckoN edited this page Jan 31, 2017 · 5 revisions

Throws a rotating model with gravity, collisions, and sound effects. Models don't fade out.

Parameters

Type Name Description
Vector pos Sarting position for the effect
Vector velocity Speed and direction of the model
float yaw Initial yaw rotation of the model
string model Model to display
uint8 bounceSound Possible values:
0 : No Sound
1 : Bullet casing
2 : Shotgun shell
uint8 life Time to display model (seconds * 0.1)

API Function

void CEntityFuncs::EjectBrass(const Vector& in vecOrigin, const Vector& in vecVelocity, float flRotation, int iModel, TE_BOUNCE soundtype)

NetworkMessage Function

void te_model(Vector pos, Vector velocity, float yaw=0, 
	string model="models/agibs.mdl", uint8 bounceSound=2, uint8 life=32,
	NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
{

	NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
	m.WriteByte(TE_MODEL);
	m.WriteCoord(pos.x);
	m.WriteCoord(pos.y);
	m.WriteCoord(pos.z);
	m.WriteCoord(velocity.x);
	m.WriteCoord(velocity.y);
	m.WriteCoord(velocity.z);
	m.WriteAngle(yaw);
	m.WriteShort(g_EngineFuncs.ModelIndex(model));
	m.WriteByte(bounceSound);
	m.WriteByte(life);
	m.End();
}
Clone this wiki locally