Skip to content

TE_MODEL

wootguy edited this page Nov 29, 2025 · 4 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
const char* model Model to display
uint8_t bounceSound Possible values: 0 : No Sound 1 : Bullet casing 2 : Shotgun shell
uint8_t life Time to display model (seconds * 0.1)

Example Usage

void te_model(Vector pos, Vector velocity, float yaw=0, 
    const char* model="models/agibs.mdl", uint8_t bounceSound=2, uint8_t life=32,
    int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{

    MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
    WRITE_BYTE(TE_MODEL);
    WRITE_COORD(pos.x);
    WRITE_COORD(pos.y);
    WRITE_COORD(pos.z);
    WRITE_COORD(velocity.x);
    WRITE_COORD(velocity.y);
    WRITE_COORD(velocity.z);
    WRITE_ANGLE(yaw);
    WRITE_SHORT(MODEL_INDEX(model));
    WRITE_BYTE(bounceSound);
    WRITE_BYTE(life);
    MESSAGE_END();
}

Clone this wiki locally