aterhot Posted March 15, 2014 Posted March 15, 2014 how to view and hide a panel with bindKey? My ingame nickname is: Perseo. progress in scripting 0,5% I'm student in computer science, design and C++ Programing (first year) . I really want to learn programming and I think this is the right place for it.
HerculePoirot Posted March 15, 2014 Posted March 15, 2014 function guiOpen() if (guiGetVisible(YOURGUI) == true) then --Check whether gui is visible or not guiSetVisible(YOURGUI, false) --if visible then close it else guiSetVisible(YOURGUI, true) --if not open it end end bindKey("F2", "down", guiOpen) --bind F2 for that function Replace YOURGUI with your gui. This is a client side script.
aterhot Posted March 15, 2014 Author Posted March 15, 2014 thanks I'm new to this and still am somewhat noob My ingame nickname is: Perseo. progress in scripting 0,5% I'm student in computer science, design and C++ Programing (first year) . I really want to learn programming and I think this is the right place for it.
Anubhav Posted March 15, 2014 Posted March 15, 2014 function guiOpen() if (guiGetVisible(YOURGUI) == true) then --Check whether gui is visible or not guiSetVisible(YOURGUI, false) --if visible then close it showCursor(false) else guiSetVisible(YOURGUI, true) --if not open it showCursor(true) end end bindKey("F2", "down", guiOpen) --bind F2 for that function Maybe this is better. He din't added the cursor which is important. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
cheez3d Posted March 15, 2014 Posted March 15, 2014 local window = guiCreateWindow(0,0,600,350,"bindKey Test",false) local showWindow = function() guiSetVisible(window,not guiGetVisible(window)) showCursor(not isCursorShowing()) end bindKey("p","down",showWindow)
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