Garry's Mod Wiki

Revision Difference

CRecipientFilter:AddPlayer#515785

<function name="AddPlayer" parent="CRecipientFilter" type="classfunc"> <description>Adds a player to the recipient filter</description> <realm>Server</realm> <args> <arg name="Player" type="Player">Player to add to the recipient filter.</arg> </args> </function> <example> <description>⤶ Adds the first player object to the recipient filter, then sends him a message.⤶ <description>Adds the first player object to the recipient filter, then sends him a message.⤶ ``` ⤶ | Code = function SendMessage()⤶ </description>⤶ <code>⤶ function SendMessage()⤶ local filter = RecipientFilter() filter:AddPlayer(Entity(1)) umsg.Start("message",filter) umsg.End() ```⤶ ⤶ end⤶ end⤶ </code>⤶ <output>Sends a usermessage to the first player object, if it exists.⤶ ``` ⤶ | Output = Sends a usermessage to the first player object, if it exists.⤶ ```⤶ ⤶ </description>⤶ </output>⤶ </example>