UTIL SayText: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Cleanup)
No edit summary
Line 1: Line 1:
[[UTIL]] wrapper function for [[UTIL_SayTextFilter]] that sends a message to a player.
{{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.


==Usage==
==Usage==
Line 8: Line 9:
==Examples==
==Examples==
<source lang=cpp>
<source lang=cpp>
    CON_COMMAND( say_self, "Sends message to self in chat" )
/* 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() ) );
{
    }
    UTIL_SayText( args, ToBasePlayer( UTIL_GetCommandClientIndex() ) );
}
</source>
</source>


[[Category:Programming]]
[[Category:UTIL]]
[[Category:UTIL]]

Revision as of 22:31, 2 November 2021

English (en)Translate (Translate)

UTIL_SayText is a wrapper UTIL function for UTIL_SayTextFilter that sends a message to a player.

Usage

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() ) );
}