Skip to content

TE_GUNSHOTDECAL

wootguy edited this page Nov 29, 2025 · 4 revisions

Applies a decal to a world or entity surface. Also spawns some black particles and a spark or two.

Parameters

Type Name Description
Vector pos Center location of the decal. It needs to be witnin a few units of a surface.
CBaseEntity* brushEnt Brush entity to apply the decal to. If null, the decal is applied to the world instead.
const char* decal Texture name from decals.wad

Example Usage

void te_gunshotdecal(Vector pos, CBaseEntity* brushEnt=NULL, const char* decal="{handi",
    int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{
    MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
    WRITE_BYTE(TE_DECAL);
    WRITE_COORD(pos.x);
    WRITE_COORD(pos.y);
    WRITE_COORD(pos.z);
    WRITE_SHORT(brushEnt == NULL ? 0 : brushEnt->entindex());
    WRITE_BYTE(g_EngineFuncs.DecalIndex(decal));
    MESSAGE_END();
}

Clone this wiki locally