I’m having some trouble with chat suggestions and templates. I think it may have something to do with the resource load order.
I want to move all chat suggestions and template events to a single resource. When I do this, my chat templates are not initializing, the only other way I have seen developers trigger chat templates is by using:
Client.lua
AddEventHandler("onClientMapStart", function()
TriggerEvent("chat:addTemplate", "blah", <blah> <b>{0}</b>: {1}")
end)
TriggerEvent("chat:addSuggestion", "blah", {{name = "num", help = "number of blahs to print}, {name = "param2", help = "some param"})
This however attempts to add the template to the server every time a client joins resulting in a local "CHAT-WARN: Tried to add duplicate template ‘blah’"
I also have been having intermediate success with chat suggestions registering with this resource.
- Does resource load order (e.g. system/chat -> chathelper) matter?
- Is this the correct way to add templates? Why am I either receiving errors or just not adding the template?
- What would cause chatsuggestions not to register and not report an error?