Jump to content

ChatBox wiki


ASiT

Recommended Posts

Posted

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) 

Posted

Oh, an error. Thanks for providing so much info, now we all know what's wrong at once.

Do NOT PM ME for help unless invited. - New MTA Script Editor

Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.

Posted

Well i dont think we need this info.

Have a look @ line 11.

bindKey ( "i", "down","toggle chat", chat ) -- the player's "i" key will toggle the chat

Shouldn't it be:

bindKey ( "i", "down", chat ) -- the player's "i" key will toggle the chat

Hmm? :D try!

Posted

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

Projects:

Slothbot | Maximap

Posted

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

Posted

The wiki is there for a reason, look at it a bit!

Just look at the function lists and you'll learn stuff like that.

http://development.mtasa.com/index.php? ... _Functions

http://development.mtasa.com/index.php? ... _Functions

Do NOT PM ME for help unless invited. - New MTA Script Editor

Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.

Posted
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)

Projects:

Slothbot | Maximap

Posted
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

Hosting your MTA:SA server! http://gta-servers.net.

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

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