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.