Garry's Mod Wiki

util.FilterText

  string util.FilterText( string str, number context = TEXT_FILTER_UNKNOWN, Player player = nil )

Description

Filters given text using Steam's filtering system. The function will obey local client's Steam settings for chat filtering:

In some cases, especially in a chatbox, messages from some players may return an empty string if the context argument used for filtering is TEXT_FILTER_CHAT and if the local player has blocked the sender of the message on Steam.
image.png

Arguments

1 string str
String to filter.
2 number context = TEXT_FILTER_UNKNOWN
Filtering context. See TEXT_FILTER enum.
3 Player player = nil
Used to determine if the text should be filtered according to local user's Steam chat filtering settings.

Returns

1 string
The filtered text based on given settings.