Jump to content

[Cuestion] SetTimer


Recommended Posts

how i add setTimer at show a GUI when aPlayerWasted?

would be ... setTimer ( souce, 5000, 1 )

what arguments should i to add and where??

for example :

  
  
function ondead() 
if (source == getLocalPlayer()) then 
 if (not isCursorShowing()) then 
  showCursor(true) 
 end 
  
GUIEditor = { 
    button = {}, 
    window = {} 
} 
  
        PANEL2 = guiCreateWindow(201, 186, 394, 172, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        JUGAR = guiCreateButton(32, 45, 150, 90, "Jugar con el mismo personaje", false, PANEL2) 
        guiSetFont(GUIEditor.button[1], "default-bold-small") 
        REGRESAR = guiCreateButton(211, 45, 150, 90, "Regresar al Menú", false, PANEL2) 
        guiSetFont(GUIEditor.button[2], "default-bold-small")  
     
             
  
addEventHandler("onClientGUIClick", JUGAR, jugarrr) 
addEventHandler("onClientGUIClick", REGRESAR, regresarrr)        
    end     
end 
addEventHandler("onClientPlayerWasted", getRootElement(), ondead)  
addEvent("onClientPlayerWasted", getRootElement(), ondead) 

Link to comment
function start() 
        PANEL2 = guiCreateWindow(201, 186, 394, 172, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        JUGAR = guiCreateButton(32, 45, 150, 90, "Jugar con el mismo personaje", false, PANEL2) 
        guiSetFont(GUIEditor.button[1], "default-bold-small") 
        REGRESAR = guiCreateButton(211, 45, 150, 90, "Regresar al Menú", false, PANEL2) 
        guiSetFont(GUIEditor.button[2], "default-bold-small") 
        guiSetVisible(PANEL2, false) 
        showCursor(false) 
addEventHandler("onClientGUIClick", JUGAR, jugarrr) 
addEventHandler("onClientGUIClick", REGRESAR, regresarrr)       
    end    
addEventHandler("onClientResourceStart", root, start) 
  
function ondead() 
if source == localPlayer then 
setTimer(guiSetVisible, 5000, 1, PANEL2, true) 
setTimer(showCursor, 5000, 1, true) 
end 
end 
addEventHandler("onClientPlayerWasted", getRootElement(), ondead) 

Link to comment

Try this:

  
function start() 
        PANEL2 = guiCreateWindow(201, 186, 394, 172, "", false) 
        guiWindowSetSizable(PANEL2, false) 
        guiSetVisible(PANEL2, false) 
  
        JUGAR = guiCreateButton(32, 45, 150, 90, "Jugar con el mismo personaje", false, PANEL2) 
        guiSetFont(JUGAR, "default-bold-small") 
        REGRESAR = guiCreateButton(211, 45, 150, 90, "Regresar al Menú", false, PANEL2) 
        guiSetFont(REGRESAR, "default-bold-small") 
         
        addEventHandler("onClientGUIClick", JUGAR, jugarrr) 
        addEventHandler("onClientGUIClick", REGRESAR, regresarrr)       
end 
addEventHandler("onClientResourceStart", resourceRoot, start) 
  
function ondead() 
if source == localPlayer then 
setTimer(guiSetVisible, 5000, 1, PANEL2, true) 
setTimer(showCursor, 5000, 1, true) 
end 
end 
addEventHandler("onClientPlayerWasted", localPlayer, ondead) 

Link to comment
Try this:
  
function start() 
        PANEL2 = guiCreateWindow(201, 186, 394, 172, "", false) 
        guiWindowSetSizable(PANEL2, false) 
        guiSetVisible(PANEL2, false) 
  
        JUGAR = guiCreateButton(32, 45, 150, 90, "Jugar con el mismo personaje", false, PANEL2) 
        guiSetFont(JUGAR, "default-bold-small") 
        REGRESAR = guiCreateButton(211, 45, 150, 90, "Regresar al Menú", false, PANEL2) 
        guiSetFont(REGRESAR, "default-bold-small") 
         
        addEventHandler("onClientGUIClick", JUGAR, jugarrr) 
        addEventHandler("onClientGUIClick", REGRESAR, regresarrr)       
end 
addEventHandler("onClientResourceStart", resourceRoot, start) 
  
function ondead() 
if source == localPlayer then 
setTimer(guiSetVisible, 5000, 1, PANEL2, true) 
setTimer(showCursor, 5000, 1, true) 
end 
end 
addEventHandler("onClientPlayerWasted", localPlayer, ondead) 

:o wow!! works thank you so much!! :')

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