UTIL PlayerDecalTrace: Difference between revisions
Jump to navigation
Jump to search

(Created Page) |
Thunder4ik (talk | contribs) m (clean up, added orphan, underlinked tags) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{Multiple issues| | ||
{{Underlinked|date=January 2024}} | |||
{{Orphan|date=January 2024}} | |||
}} | |||
{{lang|UTIL PlayerDecalTrace|title=<code>UTIL_PlayerDecalTrace</code>}} | |||
UTIL_PlayerDecalTrace is a [[UTIL]] provided in the Source code for creating Player sprays. | |||
== Usage == | == Usage == | ||
<source lang=cpp> | <source lang=cpp> | ||
Line 25: | Line 28: | ||
} | } | ||
</source> | </source> | ||
== Examples == | == Examples == |
Latest revision as of 01:22, 6 January 2024

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)

This article needs more
links to other articles to help
integrate it into the encyclopedia. Please help improve this article by adding links
that are relevant to the context within the existing text.
January 2024



January 2024

This article is an orphan, meaning that few or no articles link to it.
You can help by
adding links to this article from other relevant articles.
January 2024
You can help by

January 2024


UTIL_PlayerDecalTrace is a UTIL provided in the Source code for creating Player sprays.
Usage
/*
==============
UTIL_PlayerDecalTrace
A player is trying to apply his custom decal for the spray can.
Tell connected clients to display it, or use the default spray can decal
if the custom can't be loaded.
==============
*/
void UTIL_PlayerDecalTrace( trace_t *pTrace, int playernum )
{
if (pTrace->fraction == 1.0)
return;
CBroadcastRecipientFilter filter;
te->PlayerDecal( filter, 0.0,
&pTrace->endpos, playernum, pTrace->m_pEnt->entindex() );
}
Examples
CBasePlayer *pPlayer = ToBasePlayer( GetOwnerEntity() );
if ( pPlayer )
{
int playernum = pPlayer->entindex();
Vector forward;
trace_t tr;
AngleVectors( GetAbsAngles(), &forward );
UTIL_TraceLine ( GetAbsOrigin(), GetAbsOrigin() + forward * 128,
MASK_SOLID_BRUSHONLY, pPlayer, COLLISION_GROUP_NONE, & tr);
UTIL_PlayerDecalTrace( &tr, playernum );
}