Jump to content

Vars in SetTimer


Zafire

Recommended Posts

Posted

I need help here, because my first function works, but the second is a Delayed function, so when i use it star a timer for use the first function before X seconds

  
---------------------------------------- Dialogo Usuario ----------------------------------------- 
function crearDialogoUsuario(texto, duracion) 
    triggerClientEvent(client, "formatearDialogo", getRootElement(), texto, duracion) 
end 
-------------------------------------------------------------------------------------------------- 
  
----------------------------------- Dialogo Usuario con Delay ------------------------------------ 
function crearDialogoUsuarioDelay(texto, duracion, delay) 
    setTimer(crearDialogoUsuario, delay, 1, texto, duracion) 
end 
-------------------------------------------------------------------------------------------------- 
  

but in my SetTimer function, i cant export the vars there.. :S .. if i use my first function vars "texto", "duracion" works perfect.. but in the second one i have setTimer so i dont know to use the vars there.. dont works because the delayed function dont take the vars..

Posted
Uhm, you sent me a PM about this already, could you explain me what do you mean? I seriously don't understand.

i use crearDialogoUsuario(text, time) for create a dialog, and show it X time.. It works..

but if i use this function 2 times at the same time

example

  
crearDialogoUsuario("Hi, how are you", 4000) 
crearDialogoUsuario("Bye", 4000) 
  

that 2 dialog will appear at the same time, and i dont want that.. i want the second appears when the first finish.. before 4 seconds..

so i create crearDialogoUsuario(text, time, delay) this function supose will white the "delay" i use for show the dialog.. but it doesnt works :S using this

  
crearDialogoUsuario("Hi, how are you", 4000) 
crearDialogoUsuarioDelay("Bye", 4000, 4000) 
  

and my function is

  
----------------------------------- Dialogo Usuario con Delay ------------------------------------ 
function crearDialogoUsuarioDelay(text, time, delay) 
    setTimer(crearDialogoUsuario, delay, 1, text, time) 
end 
-------------------------------------------------------------------------------------------------------- 
  

when i use it.. say Bad Argumen @ in triggerclientevent here

  
---------------------------------------- Dialogo Usuario ----------------------------------------- 
function crearDialogoUsuario(text, time) 
    triggerClientEvent(client, "formatearDialogo", getRootElement(), text, time) 
end 
-------------------------------------------------------------------------------------------------- 
  

Posted

As I told you in the last PM I sent you about 30 seconds ago, you forgot the 'player' element, in your function you trigger 'client', but you never added such argument in the function.

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