bogoslovniy 3 Posted July 20, 2020 Share Posted July 20, 2020 I have a custom chat with chatAPI var chatAPI = { push: (message) => {...}, clear: ()=> {...}, activate: (toggle) => {...}, show: (toggle) => {...} } In 1.1.0 added new chat API initerface let api = {"chat:push": chatAPI.push, "chat:clear": chatAPI.clear, "chat:activate": chatAPI.activate, "chat:show": chatAPI.show}; for(let fn in api) { mp.events.add(fn, api[fn]); } Where do I put this piece of code to make my custom chat work? I put it in a file with an API, called it as a separate function, called from Client-side, added this new events to Client-side, but nothing helped. Link to post Share on other sites
mZentorno 2 Posted July 20, 2020 Share Posted July 20, 2020 just put the code "api" below the code "chatapi" Link to post Share on other sites
bogoslovniy 3 Posted July 20, 2020 Author Share Posted July 20, 2020 Problem solved Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now