Skip to content

TE_PLAYERDECAL

GeckoN edited this page Jan 31, 2017 · 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.

API Function

void CUtility::PlayerDecalTrace(TraceResult& in trace, int iPlayerNum, int iDecalNumber, const bool bIsCustom)

NetworkMessage Function

void te_playerdecal(Vector pos, CBasePlayer@ plr, CBaseEntity@ brushEnt=null,
	NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null)
{
	NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);
	m.WriteByte(TE_DECAL);
	m.WriteByte(plr.entindex());
	m.WriteCoord(pos.x);
	m.WriteCoord(pos.y);
	m.WriteCoord(pos.z);
	m.WriteShort(brushEnt is null ? 0 : brushEnt.entindex());
	m.WriteByte(0); // decal index does not apply here but it's still required
	m.End();
}
Clone this wiki locally