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

GamerDude27 (talk | contribs) m (Cleanup) |
m ('Usage' is vague.) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
[[UTIL]] | {{lang|UTIL SayText|title=<code>UTIL_SayText</code>}} | ||
{{ent|UTIL_SayText}} is a wrapper [[UTIL]] function for {{ent|UTIL_SayTextFilter}} that sends a message to a player. | |||
== | ==Declaration== | ||
<source lang=cpp> | <source lang=cpp> | ||
void UTIL_SayText( const char *pText, CBasePlayer *pToPlayer ) | void UTIL_SayText( const char *pText, CBasePlayer *pToPlayer ); | ||
</source> | </source> | ||
==Examples== | ==Examples== | ||
<source lang=cpp> | <source lang=cpp> | ||
/* Sent message to the player that executed `say_self`. */ | |||
CON_COMMAND( say_self, "Sends message to self in chat" ) | |||
{ | |||
UTIL_SayText( args, ToBasePlayer( UTIL_GetCommandClientIndex() ) ); | |||
} | |||
</source> | </source> | ||
[[Category:Programming]] | |||
[[Category:UTIL]] | [[Category:UTIL]] |
Latest revision as of 18:26, 3 November 2021


UTIL_SayText is a wrapper UTIL function for UTIL_SayTextFilter that sends a message to a player.
Declaration
void UTIL_SayText( const char *pText, CBasePlayer *pToPlayer );
Examples
/* Sent message to the player that executed `say_self`. */
CON_COMMAND( say_self, "Sends message to self in chat" )
{
UTIL_SayText( args, ToBasePlayer( UTIL_GetCommandClientIndex() ) );
}