Skip to content

TE_PLAYERDECAL

wootguy edited this page Nov 29, 2025 · 4 revisions

Applies a player's custom spray to a world or entity surface.

Parameters

Type Name Description
Vector pos Center location of the decal. It needs to be witnin a few units of a surface.
CBasePlayer@ plr Player to load spray from
CBaseEntity* brushEnt Brush entity to apply the decal to. If null, the decal is applied to the world instead.

Example Usage

void te_playerdecal(Vector pos, CBasePlayer@ plr, CBaseEntity* brushEnt=NULL,
    int msgType=MSG_BROADCAST, edict_t* dest=NULL)
{
    MESSAGE_BEGIN(msgType, SVC_TEMPENTITY, dest);
    WRITE_BYTE(TE_DECAL);
    WRITE_BYTE(plr->entindex());
    WRITE_COORD(pos.x);
    WRITE_COORD(pos.y);
    WRITE_COORD(pos.z);
    WRITE_SHORT(brushEnt == NULL ? 0 : brushEnt->entindex());
    WRITE_BYTE(0); // decal index does not apply here but it's still required
    MESSAGE_END();
}

Clone this wiki locally