#RooTs Posted August 24, 2014 Share Posted August 24, 2014 showChat does not work In MTA 1.4 ??? local isChatVisible = true function chat ( key, keyState ) if isChatVisible then showChat ( false ) isChatVisible = false else showChat ( true ) isChatVisible = true end end bindKey ( "i", "down", chat ) Link to comment
Bonsai Posted August 24, 2014 Share Posted August 24, 2014 isChatVisible has become a function in 1.4 That wiki example is kinda outdated now. Link to comment
#RooTs Posted August 25, 2014 Author Share Posted August 25, 2014 isChatVisible has become a function in 1.4That wiki example is kinda outdated now. how about it? Link to comment
Et-win Posted August 25, 2014 Share Posted August 25, 2014 local isChatVisible = true 'isChatVisible' is now a code in MTA, which means, just use that code instead of the variable. Link to comment
#RooTs Posted August 25, 2014 Author Share Posted August 25, 2014 local isChatVisible = true 'isChatVisible' is now a code in MTA, which means, just use that code instead of the variable. it did not help me at all my script does not work local isChatVisible = true -- their line function chat ( key, keyState ) if isChatVisible then showChat ( false ) isChatVisible = false else showChat ( true ) isChatVisible = true end end bindKey ( "i", "down", chat ) Link to comment
Bonsai Posted August 25, 2014 Share Posted August 25, 2014 Whats wrong with u? showChat(not isChatVisible()) Link to comment
#RooTs Posted August 25, 2014 Author Share Posted August 25, 2014 isChatVisible has become a function in 1.4That wiki example is kinda outdated now. I think this function, does not work anymore Link to comment
Bonsai Posted August 25, 2014 Share Posted August 25, 2014 isChatVisible has become a function in 1.4That wiki example is kinda outdated now. I think this function, does not work anymore Link to comment
Et-win Posted August 25, 2014 Share Posted August 25, 2014 I changed the example on the wiki, maybe you will understand it now: https://wiki.multitheftauto.com/wiki/ShowChat#Example 'isChatVisible' is now a code in MTA, like I said: https://wiki.multitheftauto.com/wiki/IsChatVisible Link to comment
stranger.eu Posted August 25, 2014 Share Posted August 25, 2014 Try this function chatFunc () if(isChatVisible() == true) then showChat(false) else showChat(true) end end bindKey("i", "down", chatFunc) Link to comment
#RooTs Posted August 25, 2014 Author Share Posted August 25, 2014 Try this function chatFunc () if(isChatVisible() == true) then showChat(false) else showChat(true) end end bindKey("i", "down", chatFunc) Working thanks, how can I add Huds ( ammo, health, money, etc.. ) showPlayerHudComponent ( "health", false ) function chatFunc () if(isChatVisible() == true) then showChat(false) else showChat(true) end end bindKey("i", "down", chatFunc) Link to comment
stranger.eu Posted August 25, 2014 Share Posted August 25, 2014 local components = {"ammo","area_name","armour","breath","clock","health","money","radar","vehicle_name","weapon","radio","wanted","crosshair"} function changeState () for _,component in ipairs(components)do if(isPlayerHudComponentVisible(component) == true and isChatVisible() == true) then showPlayerHudComponent("all", false) showChat(false) else showPlayerHudComponent("all", true) showChat(true) end end end bindKey("i", "down", changeState) Link to comment
#RooTs Posted August 25, 2014 Author Share Posted August 25, 2014 local components = {"ammo","area_name","armour","breath","clock","health","money","radar","vehicle_name","weapon","radio","wanted","crosshair"} function changeState () for _,component in ipairs(components)do if(isPlayerHudComponentVisible(component) == true and isChatVisible() == true) then showPlayerHudComponent("all", false) showChat(false) else showPlayerHudComponent("all", true) showChat(true) end end end bindKey("i", "down", changeState) Thanks Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now