Fabio(GNR) Posted January 1, 2011 Share Posted January 1, 2011 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
NotAvailable Posted January 1, 2011 Share Posted January 1, 2011 maybe do: showCursor(false) Instead of: showCursor(false, false) Link to comment
Fabio(GNR) Posted January 2, 2011 Author Share Posted January 2, 2011 maybe do: showCursor(false) Instead of: showCursor(false, false) Tried, but thanks Link to comment
Scooby Posted January 2, 2011 Share Posted January 2, 2011 is this only part of it? i notice you use guiSetInputEnabled but i dont see any need for this since theres no editboxes. Link to comment
Fabio(GNR) Posted January 2, 2011 Author Share Posted January 2, 2011 is this only part of it? i notice you use guiSetInputEnabled but i dont see any need for this since theres no editboxes. Don't you need it for buttons? but i also set it to false so.... Link to comment
Scooby Posted January 2, 2011 Share Posted January 2, 2011 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
Fabio(GNR) Posted January 2, 2011 Author Share Posted January 2, 2011 no, its used to disable input keys from mta/gtalike 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
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