Difference between revisions of "TE PLAYERDECAL"
Jump to navigation
Jump to search
Outerbeast (talk | contribs) (Created page with "frame|TE_PLAYERDECAL Applies a player's custom spray to a world or entity surface. <code>CUtility</code> method: <code>void PlayerDecalTrace(Trace...") |
(No difference)
|
Latest revision as of 15:14, 21 October 2025
Applies a player's custom spray to a world or entity surface.
CUtility method:
void PlayerDecalTrace(TraceResult& in trace, int iPlayerNum, int iDecalNumber, const bool bIsCustom)
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();
}
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.
