Jump to content

guiGetVisible


Recommended Posts

Hi guys.

I have this script to create an image on the screen, but wish he begins guiSetVisible false.

But when I start the resource in the image appear without me typing "t" /head

How to make the image appear only after typing /head?

local screenWidth,screenHeight = guiGetScreenSize() 
gRoot    = getRootElement() 
gResRoot = getResourceRootElement( getThisResource() ) 
  
addEventHandler("onClientResourceStart", gResRoot, 
    function () 
        imag = guiCreateStaticImage ( 0.505, 0.378, 0.05, 0.05, "head.png", true ) 
    end 
) 
function changeVisibility ( ) 
        if guiGetVisible ( imag ) then 
                guiSetVisible ( imag, false ) 
        else 
                guiSetVisible ( imag, true ) 
        end 
end 
addCommandHandler("head", changeVisibility) 

Link to comment

Hide the image after you create it.

addEventHandler ( "onClientResourceStart", gResRoot, 
    function ( ) 
        imag = guiCreateStaticImage ( 0.505, 0.378, 0.05, 0.05, "head.png", true ) 
        guiSetVisible ( imag, false ) 
    end 
) 

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