Only be considered when the timer is running. ??
Code:timer.Once(5, () => { ... });Code:void OnPlayerAttack(BasePlayer attacker, HitInfo hitinfo) { var gettingdmg = hitinfo.Initiator as BasePlayer; var playehits = hitinfo.HitEntity as BasePlayer; if (gettingdmg) { if(hitinfo.isHeadshot) { totalheadshot += 1; } else { if(playehits) { totalhits += 1; } } } }
Period of time in which to perform.
Discussion in 'Rust Development' started by Sauron 2, Jun 25, 2016.
-
Your first snippet means, the timer would start once after 5 seconds wait-time and exeute "..."
-
I started not long ago to study and I do not know how to keep time.
-
Code:
timer.Once(5, () => { ...will be delayed 5 secs <<<< }); ...code afterwards will not be delayed -
I understood it.And how do I keep the time, and only for that period for example consider the hit in the head?.
