faisl2002 Posted March 20, 2012 Share Posted March 20, 2012 السلام عليكم بسم الله الرحمن الرحيم ابغا كود اذا احد ضغط على زر في نافذة او بدون نافذة وعند الضغط على الزر تشتغل وظيفة معينة وشكرا انتظركم Link to comment
Sparrow Posted March 20, 2012 Share Posted March 20, 2012 -- function guiCreateWindow guiCreateButton -- event 'onClientGUIClick' Link to comment
faisl2002 Posted March 20, 2012 Author Share Posted March 20, 2012 مافهمته اشرحلي لو سمحت Link to comment
Sparrow Posted March 20, 2012 Share Posted March 20, 2012 (edited) testWindow = guiCreateWindow(505,148,194,119,"Test Window",false) -- we create a window close_Button = guiCreateButton(48,42,89,35,"Close",false,testWindow) -- we create a button function onResourceStart () guiSetVisible(testWindow, false) -- didn't show the gui when resource start end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) function showTheWindow() getVisible = guiGetVisible(testWindow) player = getPlayerName(localPlayer) if (getVisible == false) then guiSetVisible(testWindow, true) showCursor(true) end end addCommandHandler("show_window", showTheWindow) function closeTheWindow() guiSetVisible(testWindow, false) -- remove the window from the screen showCursor(false) -- remove the mouse from the screen end addEventHandler("onClientGUIClick", close_Button, closeTheWindow, false) -- add an event to close close the gui Edited March 20, 2012 by Guest Link to comment
faisl2002 Posted March 20, 2012 Author Share Posted March 20, 2012 شكرا تذكر الكود حق التيم فيه خطأ Link to comment
faisl2002 Posted March 20, 2012 Author Share Posted March 20, 2012 معقد ذا الكود خخخخخ 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