Deep thinker Posted June 19, 2017 Share Posted June 19, 2017 السلام عليكم انا كنت بعمل كود ل GUI وكل ما ادوس علي الزر مايشتغل GUIEditor = { button = {}, window = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(370, 357, 405, 175, "Mobile Operation Center", false) guiSetVisible(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF004F06") GUIEditor.label[1] = guiCreateLabel(22, 23, 364, 25, "_______________Welcome in The M.O.C GUI_________________________", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 0, 0, 0) GUIEditor.label[2] = guiCreateLabel(22, 54, 190, 18, "M.O.C is used by the Military team only.", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[2], 17, 153, 3) GUIEditor.label[3] = guiCreateLabel(22, 87, 218, 19, "M.O.C is used in the hard missions only.", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[3], 17, 153, 3) GUIEditor.label[4] = guiCreateLabel(22, 122, 218, 19, "This GUI is just a test.", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[4], 17, 153, 3) GUIEditor.button[1] = guiCreateButton(262, 121, 129, 44, "ENTER", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(361, 24, 25, 34, "X", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") end ) addEvent("click",true) addEventHandler("click",getRootElement(), function () guiSetVisible(GUIEditor.window[1], true) end) addEventHandler ('onClientGUIClick',GUIEditor.button[1], function ( ) guiSetVisible ( GUIEditor.window[1],false ) showCursor ( false ) triggerServerEvent ("wtfis",localPlayer) end ) addEventHandler ('onClientGUIClick',GUIEditor.button[2], function ( ) guiSetVisible ( GUIEditor.window[1],false ) end ) حياكم الله كل عام وانتم بخير اخواني Link to comment
#kAsR Posted June 19, 2017 Share Posted June 19, 2017 addEventHandler ( "onClientGUIClick" , resourceRoot , function () if ( source == GUIEditor.button[1] ) then guiSetVisible ( GUIEditor.window[1],false ) showCursor ( false ) triggerServerEvent ("wtfis",localPlayer) elseif ( source == GUIEditor.button[2] ) then guiSetVisible ( GUIEditor.window[1] , false ) end end ) 1 Link to comment
Deep thinker Posted June 19, 2017 Author Share Posted June 19, 2017 6 minutes ago, #kAsR said: addEventHandler ( "onClientGUIClick" , resourceRoot , function () if ( source == GUIEditor.button[1] ) then guiSetVisible ( GUIEditor.window[1],false ) showCursor ( false ) triggerServerEvent ("wtfis",localPlayer) elseif ( source == GUIEditor.button[2] ) then guiSetVisible ( GUIEditor.window[1] , false ) end 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