Skip to content

TE_SPRITE_SPRAY

wootguy edited this page Nov 29, 2025 · 4 revisions

Throws sprites in some direction. Sprites have gravity, fade out, and pass through the world.

Parameters

Type Name Description
Vector pos Point to spray sprites from
Vector dir Direction of the spray
const char* sprite Sprite to display (alpha transparency)
uint8_t count Number of sprites to spawn
uint8_t speed Initial sprite speed
uint8_t noise Amount to randomize speed and direction

Example Usage

void te_spritespray(Vector pos, Vector dir, 
    const char* sprite="sprites/bubble.spr", uint8_t count=8, 
    uint8_t speed=16, uint8_t noise=255,
    int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{
    MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
    WRITE_BYTE(TE_SPRITE_SPRAY);
    WRITE_COORD(pos.x);
    WRITE_COORD(pos.y);
    WRITE_COORD(pos.z);
    WRITE_COORD(dir.x);
    WRITE_COORD(dir.y);
    WRITE_COORD(dir.z);
    WRITE_SHORT(MODEL_INDEX(sprite));
    WRITE_BYTE(count);
    WRITE_BYTE(speed);
    WRITE_BYTE(noise);
    MESSAGE_END();
}

Clone this wiki locally