Ac[T]ioN Posted May 5, 2015 Share Posted May 5, 2015 السلام عليكم ورحمة الله وبركاته إخواني معي كود يخلي النافذة تتحرك بس لما أفتحه لاول مره تتحرك وبعد كذا ماعادت تتحرك لو فتحته أبغي أعدل عليها لما أسوي زر تتحرك وهذا الكود: local v,y = guiGetPosition(guiElement,true) local v = 400 local y = 100 function Move() guiSetPosition(Window_panel,v,y,false) y = y +1 end addEventHandler("onClientRender",getRootElement(),Move) setTimer(function() removeEventHandler("onClientRender",getRootElement(),Move) end,3000,1) وشكراً Link to comment
The Killer Posted May 5, 2015 Share Posted May 5, 2015 function # bindKey addEventHandler removeEventHandler guiSetVisible Link to comment
yazan Posted May 5, 2015 Share Posted May 5, 2015 bindKey("f7","down", function () guiSetVisible(Window_panel,not guiGetVisible(Window_panel)) showCursor(guiGetVisible(Window_panel)) guiMoveRightToCenter(Window_panel) end) TimeGuiSetRightC = { } function guiMoveRightToCenter(gui) if getElementData(gui,"HelhGui") == false then setElementData(gui,"HelhGui",true) local s1,s2=guiGetScreenSize() local w1,w2=guiGetSize(gui,false) local x,y = (s1-w1)/2,(s2-w2)/2 guiSetPosition(gui,-x,y,false) TimeGuiSetRightC[gui] = setTimer(guiMoveRightToCenter,50,0,gui) end local a,b=guiGetScreenSize() local w1,w2=guiGetSize(gui,false) local x,y = (a-w1)/2,(b-w2)/2 local x1,y1 = guiGetPosition ( gui, false) if (x1 >= x) then killTimer(TimeGuiSetRightC[gui]) setElementData(gui,"HelhGui",false) else guiSetPosition(gui,x1+20,y,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