sirboring Posted February 24, 2017 Share Posted February 24, 2017 (edited) Hy guys , I'm trying to make some really basic chat system as a way to learn the basics of lua / mta scripting. I have something like this: function chatMain(pl, cmd, ...) --shared logic -- ... if(cmd == "c") ... elseif(cmd == "me") ... end end -- ... addCommandHandler("c", chatMain) addCommandHandler("s", chatMain) addCommandHandler("me", chatMain) addCommandHandler("do", chatMain) addCommandHandler("b", chatMain) Everything seems to be working just fine except /me It uses mta's default code rather than mine. How can i change that ? I tried with this addEventHandler("onPlayerCommand", root, function(cmd) if (cmd == "me") then chatMain(source ,"me" ,...) end end) but it's obviously wrong... Thanks. Edited February 24, 2017 by sirboring Link to comment
Om. Posted February 24, 2017 Share Posted February 24, 2017 (edited) not so exp, but tried using cancelEvent() before calling chatMain function? Edited February 24, 2017 by Om. Link to comment
sirboring Posted February 25, 2017 Author Share Posted February 25, 2017 12 hours ago, Mr.Loki said: I've seen that topic but somehow missed the solution. Thanks. Link to comment
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