Jump to content

ChatBox wiki


ASiT

Recommended Posts

I found this code on the development wiki when looking for a way to disable the chatbox ...this should do it ...but when i started it it said there was an error at line 11...btw i was making it into a script if that helps...

local isChatVisible = true         -- let's assume the chat is visible 
function chat ( key, keyState ) 
        if ( isChatVisible ) then    -- if it's on 
                showChat (false)     -- turn it off 
                isChatVisible = false 
        else 
                showChat = (true)      -- if it's off 
                isChatVisible = true   -- turn it on 
        end 
end 
bindKey ( "i", "down","toggle chat", chat ) -- the player's "i" key will toggle the chat 
  
addEventHandler("onPlayerJoin", getRootElement(), chat) 

Link to comment

Lol, looks kind of weird... >.<

Anyway, it looks like client-side and server-side mixed anyway...

I mean: showChat and the build of the bindKey look client-side, while it has a server-side event handler... Try instead of:

addEventHandler("onPlayerJoin", getRootElement(), chat) 

This...

addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), chat) --Makes sure it only triggers at the start of only this resource 

And ofcourse the thing Simbad said, I don't understand what the "toggle chat" is doing there anyway... >.<

Link to comment

This is I think the simplest way to show/hide chat with "i" key, here:

local isChatVisible = true 
bindKey( "i", "down", 
    function( ) 
        isChatVisible = not isChatVisible; 
        showChat( isChatVisible ); 
    end 
) 

Link to comment
do you guys know how to turn off like when i see another player i see their name and health above their head .... do you know how to turn that off as well when i push "i" or is it not possible to turn it off...?

For as far as I know you can't disable other player's healthbars. You can do it with Nametags! (that's a hint, look for it in the pages Robhol gave :P)

Link to comment
do you guys know how to turn off like when i see another player i see their name and health above their head .... do you know how to turn that off as well when i push "i" or is it not possible to turn it off...?

For as far as I know you can't disable other player's healthbars. You can do it with Nametags! (that's a hint, look for it in the pages Robhol gave :P)

Of course it is, if we are talking about the bar which is going through the body of the players... In the ChatBox its the command /shownametags. Then all is disabled, i actually dont know the function inside the wiki...

But interesting point: Is there a possibility of Executing a Command? (No, i do not mean executeCommandHandler).

Would be nice like executeCommand("shownametags",source).

This would save veeeery much work, and make the using of TriggerServer/CientEvent unnecessary in many cases. Tell me if this is bullshit xD

Link to comment
do you guys know how to turn off like when i see another player i see their name and health above their head .... do you know how to turn that off as well when i push "i" or is it not possible to turn it off...?

For as far as I know you can't disable other player's healthbars. You can do it with Nametags! (that's a hint, look for it in the pages Robhol gave :P)

Of course it is, if we are talking about the bar which is going through the body of the players... In the ChatBox its the command /shownametags. Then all is disabled, i actually dont know the function inside the wiki...

But interesting point: Is there a possibility of Executing a Command? (No, i do not mean executeCommandHandler).

Would be nice like executeCommand("shownametags",source).

This would save veeeery much work, and make the using of TriggerServer/CientEvent unnecessary in many cases. Tell me if this is :~ xD

There is no other function to execute command.

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