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)