Jump to content

[Cuestion] SetTimer


Recommended Posts

Posted

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) 

560x95_FFFFFF_FF9900_000000_000000.png
Posted
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) 

State: Inactive

Posted

do not work :( i start the script and show PANEL2 keeping always but without buttons and when i kill myself only show the cursor.. ( buttons never appeared ) u.u

560x95_FFFFFF_FF9900_000000_000000.png
Posted

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) 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
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!! :')

560x95_FFFFFF_FF9900_000000_000000.png
Posted

You're welcome.

Please do not PM me with scripting related question nor support, use the forums instead.

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