Skip to content

TE_SPRAY

wootguy edited this page Nov 29, 2025 · 4 revisions

Throws sprites or models in some direction.

Parameters

Type Name Description
Vector pos Point to spray sprites from
Vector dir Direction of the spray
const char* model Sprite or model to display
uint8_t count Number of sprites/models to spawn
uint8_t speed Initial sprite/model speed
uint8_t noise Amount to randomize speed and direction
uint8_t renderMode Render mode

Example Usage

void te_spray(Vector pos, Vector dir, 
    const char* model="sprites/bubble.spr", uint8_t count=8, 
    uint8_t speed=16, uint8_t noise=255, uint8_t renderMode=kRenderTransAlpha,
    int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{
    MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
    WRITE_BYTE(TE_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(model));
    WRITE_BYTE(count);
    WRITE_BYTE(speed);
    WRITE_BYTE(noise);
	WRITE_BYTE(renderMode);
    MESSAGE_END();
}

Clone this wiki locally