Jump to content

Shutting down panel when dead


TheHead

Recommended Posts

I would like to make it when player is died/wasted/killed . The panel closes immediately 

Client

Window_CHK = guiCreateWindow(screX/2-170,screY/2-60,290,140," Vehicle Sales",false)
guiSetVisible(Window_CHK, false)
guiSetAlpha(Window_CHK, 0.97)
guiSetProperty(Window_CHK, "AlwaysOnTop", "true")
guiWindowSetSizable(Window_CHK, false)
Label_CHK = guiCreateLabel(12,28,266,36,"",false,Window_CHK)
guiLabelSetHorizontalAlign(Label_CHK,"center",true)
Button_CHK_Y = guiCreateButton(10,73,129,36,"Yes",false,Window_CHK)
Button_CHK_N = guiCreateButton(150,73,129,36,"No",false,Window_CHK)
--- Code that should close the panel but not working
function hideGUIOnPlayerDeath() 
    if guiSetVisible( Window_CHK ) then 
        guiSetVisible( Window_CHK, false ) 
    end 
end 
addEvent("closePANEL",true) 
addEventHandler( "closePANEL", root, hideGUIOnPlayerDeath )
function hideGUIOnPlayerDeath() 
    triggerClientEvent( source, "closePANEL", source ) 
end 
addEventHandler( "onPlayerWasted", root, hideGUIOnPlayerDeath ) 

Server ^

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...