Jump to content

seTimer y Comando


Javier

Recommended Posts

Posted

Hola amigos, Tengo una duda de como hacer esto:

Cuando un player ponga un determinado comando, Como le hago para que cada sierto tiempo pueda volver a escribirlo? Es decir, vuelva a funcionar el commando.

Gracias.

Posted

Te dejo un ejemplo simple:

local heCan = true  
  
addCommandHandler( "sanar",  
     function ( thePlayer ) 
       if heCan then 
         setElementHealth( thePlayer, 100) 
         heCan = false 
         setTimer( function() heCan = true end, 2000, 1 ) 
       end 
     end 
) 

Developer @ MYVAL

Posted

No te aconsejo usar timers, no son muy eficientes, usa getTickCount.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...