Jump to content

showChat does not work


#RooTs

Recommended Posts

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
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
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
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
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 :D

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