Jump to content

onConsole triggering for handled commands


Lestat

Recommended Posts

https://wiki.multitheftauto.com/wiki/OnConsole

"Note: The event will not be triggered if the message can be processed by an existing command handler"

  
function inputConsole ( text ) 
    if ( getElementType ( source ) == "player" ) then 
        --Typed by a Player 
        outputChatBox("Player C: "..text, getRootElement()) 
    else 
        --Typed by the Server Console 
        outputChatBox("Server C: "..text, getRootElement()) 
    end 
end 
addEventHandler ( "onConsole", getRootElement(), inputConsole ) 
  

When I first created this code it worked flawlessly, the event only triggered for non-handled(non-existent) commands. But after sometime (refreshing resources, restarting the server etc), now the events triggers even for handled commands. Is it a bug? or am I missing something?

Or maybe I imagined it and it triggered for handled commands since the start.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...