Jump to content

GUI Cursor isn't hiding


Fabio(GNR)

Recommended Posts

well title describes, ( part of ) script:

function hidegui() 
if guiGetVisible ( weapwindow ) then 
                guiSetInputEnabled ( false ) 
                guiSetVisible ( weapwindow, false )          
                showCursor( false, false ) 
  
     end 
end 
  
function showgui () 
weapwindow = guiCreateWindow(307,127,480,516,"Weapons Menu",false) 
CloseButton = guiCreateButton(180,375,108,41,"Close",false,weapwindow) 
guiSetVisible ( weapwindow, true ) 
showCursor(true) 
addEventHandler("onClientGUIClick", CloseButton, hidegui, false) 
guiSetInputEnabled(true) 
  
  --end 
end 
  

The window goes away but im not able to use chatbox, keys ( walking etc. ) or the mouse ( well except the cursor )

Link to comment

no, its used to disable input keys from mta/gta

like if u had an editbox where u could type, u would need to disable mta keys so 't' didnt bring up the chatbox or various binds dont interfere with what ur typing. but for u, u dont need it, u just need to show cursor so u can click a button.

just swapped a few bits round quickly, have a try of it set out like this:

function onStart( resource ) 
     
    creategui() 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onStart) 
  
function creategui () 
    weapwindow = guiCreateWindow(307,127,480,516,"Weapons Menu",false) 
    CloseButton = guiCreateButton(180,375,108,41,"Close",false,weapwindow) 
    addEventHandler("onClientGUIClick", CloseButton, hidegui, false) 
    guiSetVisible ( weapwindow, false ) 
end 
  
function hidegui() 
    if guiGetVisible ( weapwindow ) then 
                guiSetVisible ( weapwindow, false )         
                showCursor( false ) 
     end 
end 
  
function showgui () 
    if not guiGetVisible ( weapwindow ) then 
        guiSetVisible ( weapwindow, true )  
        showCursor( true ) 
    end 
end 
addCommandHandler("weapwindow",showgui) 
  

also ul need to add a way to trigger it, im guessing ul add this once uve added the rest.

ive added the command /weapwindow for u to show it.

Link to comment
no, its used to disable input keys from mta/gta

like if u had an editbox where u could type, u would need to disable mta keys so 't' didnt bring up the chatbox or various binds dont interfere with what ur typing. but for u, u dont need it, u just need to show cursor so u can click a button.

just swapped a few bits round quickly, have a try of it set out like this:

CODE 
  

also ul need to add a way to trigger it, im guessing ul add this once uve added the rest.

ive added the command /weapwindow for u to show it.

Thanks will try that order :)

EDIT: Worked thanks Scooby and JesseUnit

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