Vanlot Posted September 6, 2012 Share Posted September 6, 2012 "انا جديد بالبرمجة و نحب نصنع "لوقن بانل I want function which let me open new Window when i press a button. My friend Sparrow gave me this function: function nub() if (source == registerBtn) then guiSetVisible(registerWindow, true) guiBringToFront(registerWindow) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), nub) but it didn't work. Help plz , Thanx Link to comment
Tete omar Posted September 6, 2012 Share Posted September 6, 2012 "انا جديد بالبرمجة و نحب نصنع "لوقن بانلI want function which let me open new Window when i press a button. My friend Sparrow gave me this function: function nub() if (source == registerBtn) then guiSetVisible(registerWindow, true) guiBringToFront(registerWindow) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), nub) but it didn't work. Help plz , Thanx firstly getResourceRootElement(getThisResource()) doesn't make sense with ' onClientGUIClick ' try this function nub() if (source == registerBtn) then guiSetVisible(registerWindow, true) guiBringToFront(registerWindow) end end addEventHandler("onClientGUIClick", root, nub) root = getRootElement() P.S. this getResourceRootElement(getThisResource()) make more sense with https://wiki.multitheftauto.com/wiki/OnResourceStart or https://wiki.multitheftauto.com/wiki/OnC ... ourceStart and this is predefined as 'resourceRoot' resourceRoot = getResourceRootElement(getThisResource()) that's better Link to comment
Vanlot Posted September 6, 2012 Author Share Posted September 6, 2012 It didn't work. Link to comment
abu5lf Posted September 6, 2012 Share Posted September 6, 2012 وش الخطأ في الكود وياليت عربي لأن المنتدى عربي Link to comment
./BlackBird# Posted September 6, 2012 Share Posted September 6, 2012 وش الخطأ في الكود وياليت عربي لأن القسم عربي ^^ Link to comment
Vanlot Posted September 6, 2012 Author Share Posted September 6, 2012 وش الخطأ في الكود وياليت عربي لأن المنتدى عربي تظهر .بس هي مبتظهر. شكرا "registerWindow" لازم الويندو "Register" لما اظغط على Link to comment
abu5lf Posted September 6, 2012 Share Posted September 6, 2012 شف المثال هذه يمكن يفيدك addEventHandler ( 'onClientResourceStart', resourceRoot, function () Window = guiCreateWindow(...) Button = guiCreateButton(...) guiSetVisible ( Window, false ) addEventHandler ( 'onClientGUIClick', Button, Visible, false ) end ) function Visible () guiSetVisible ( Window, not guiGetVisible ( Window ) ) end 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