Saudi Server Posted August 18, 2010 Posted August 18, 2010 hello how r u pls How to Make button Close works i am created windows , images and button close but not work close ^^ http://img842.imageshack.us/img842/110/98979157.jpg I'm waiting for your help
Castillo Posted August 18, 2010 Posted August 18, 2010 (edited) function closeGUI () if (source == YOUR_GUI_BUTTON_ELEMENT) then guiSetVisible ( YOURGUIWINDOW, false ) end end addEventHandler("onClientGUIClick",YOUR_GUI_BUTTON_ELEMENT,closeGUI,false) Edited August 18, 2010 by Guest San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted August 18, 2010 Posted August 18, 2010 Where Added ? To your lua file...? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
dzek (varez) Posted August 18, 2010 Posted August 18, 2010 share your code with us if you want ask us where to put code.. Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Saudi Server Posted August 18, 2010 Author Posted August 18, 2010 (edited) ok code lua : GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(107,86,630,459,"saudi ! ~",false) GUIEditor_Image[1] = guiCreateStaticImage(67,31,516,380,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(9,395,119,55,"Close",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[1],"clear-normal") Edited August 18, 2010 by Guest
Saudi Server Posted August 18, 2010 Author Posted August 18, 2010 ^^ where add function closeGUI () if (source == YOUR_GUI_BUTTON_ELEMENT) then guiSetVisible ( YOURGUIWINDOW, false ) end end addEventHandler("onClientGUIClick",YOUR_GUI_BUTTON_ELEMENT,closeGUI,false)
Castillo Posted August 18, 2010 Posted August 18, 2010 GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(107,86,630,459,"saudi ! ~",false) GUIEditor_Image[1] = guiCreateStaticImage(67,31,516,380,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(9,395,119,55,"Close",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[1],"clear-normal") function closeGUI () if (source == GUIEditor_Button[1]) then guiSetVisible ( GUIEditor_Window[1], false ) end end addEventHandler("onClientGUIClick",GUIEditor_Button[1],closeGUI,false) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Saudi Server Posted August 18, 2010 Author Posted August 18, 2010 thxx solid But does not appear the mouse pointer and I want it begins with the start server
Castillo Posted August 18, 2010 Posted August 18, 2010 thxx solid But does not appear the mouse pointer and I want it begins with the start server Do you know about something called "mta wiki"? well there you can find showCursor function and check how it works. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
dzek (varez) Posted August 18, 2010 Posted August 18, 2010 HERE ARE ANSWERS FOR ALL YOUR QUESTIONS Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Saudi Server Posted August 18, 2010 Author Posted August 18, 2010 ok thxx man I will never forget kindness
Dark Dragon Posted August 18, 2010 Posted August 18, 2010 the source check is unneeded Loads of fun for free! Also a lot of fun for free!
Castillo Posted August 18, 2010 Posted August 18, 2010 the source check is unneeded I've had problems before thats why i added it, like i click on any gui part not the element i want and it executes the function. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
dzek (varez) Posted August 18, 2010 Posted August 18, 2010 this is achieved with 4th argument (false) in addEventHandler. So again: Source check is unneeded Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Callum Posted August 18, 2010 Posted August 18, 2010 I find a more efficient way is; addEventHandler("onClientGUIClick",GUIEditor_Button[1],function() guiSetVisible(GUIEditor_Window[1],false) end,false) Add that right below the line of code on which the button is created. Retired
50p Posted August 19, 2010 Posted August 19, 2010 I find a more efficient way is; addEventHandler("onClientGUIClick",GUIEditor_Button[1],function() guiSetVisible(GUIEditor_Window[1],false) end,false) Add that right below the line of code on which the button is created. Even more efficient way: addEventHandler("onClientGUIClick",GUIEditor_Button[1],function() guiSetVisible(source,false) end,false) - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
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