Jump to content

طلب كود اذا احد ضغط على زر في نافذة تعمل وظيف


Recommended Posts

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 by Guest
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...