TheHead Posted February 4, 2020 Share Posted February 4, 2020 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
Moderators Patrick Posted February 4, 2020 Moderators Share Posted February 4, 2020 In line 12 you need to use guiGetVisible. 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