@@ -52,10 +52,10 @@ By default, the chat box will only load pictures from trusted websites. You can
52
52
53
53
### For developers
54
54
55
- You can prevent links from certain players from embedding, by using the ` CanEmbedCustomChat ` hook on the ** clientside ** .
55
+ You can prevent links from certain players from embedding, by using the ` CanEmbedCustomChat ` hook on the ** client side ** :
56
56
57
57
``` lua
58
- hook .Add ( " CanEmbedCustomChat" , " override_chat_embed_access " , function ( ply , url , urlType )
58
+ hook .Add ( " CanEmbedCustomChat" , " chat_embed_access_example " , function ( ply , url , urlType )
59
59
-- return false to block embeds from "url"
60
60
61
61
-- "urlType" will be one of these strings:
@@ -69,6 +69,23 @@ hook.Add( "CanEmbedCustomChat", "override_chat_embed_access", function( ply, url
69
69
end )
70
70
```
71
71
72
+ You can add more or override chat tags via code, using this hook on the ** client side** :
73
+
74
+ ``` lua
75
+ hook .Add ( " OverrideCustomChatTags" , " custom_tags_example" , function ( ply )
76
+ -- A sequential table with strings, colors or anything really
77
+ local parts = {
78
+ color_black , " (" , Color ( 0 , 0 , 255 ), " The " .. team .GetName ( ply :Team () ), color_black , " ) "
79
+ }
80
+
81
+ -- Should we keep the original custom tags that
82
+ -- were added on the "[Admin] Chat Tags" menu?
83
+ local keepOriginalParts = true
84
+
85
+ return parts , keepOriginalParts
86
+ end )
87
+ ```
88
+
72
89
## Contributing
73
90
74
91
Before you open a pull request, please read [ this] ( https://github.com/StyledStrike/gmod-custom-chat/blob/master/.github/pull_request_template.md ) .
0 commit comments