Jump to content

onChatMessage bugged?


kaos057

Recommended Posts

the server side function onChatMessage does not seem to be sending the right parameter for player/resource. When a regular message is received, the player parameter is nil. When a message is received from team, the player parameter is the team element. Is this supposed to be like this or is it a bug?

Link to comment

try this:

    function onConsoleSay ( text ) 
        if isElement(console) then           ---Or if source == console then 
            cancelEvent() 
            outputChatBox("The best console: "..text, root, 0, 255, 0) 
         end 
    end 
      
    addEventHandler("onChatMessage", root, onConsoleSay) 

I got it from this topic: viewtopic.php?f=91&t=42598&p=430495&hilit=onChatMessage#p430495

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...