Author Topic: Delay  (Read 770 times)

0 Members and 2 Guests are viewing this topic.

Offline Surfzy

  • Major(1)
  • Posts: 9
  • Living the life
Delay
« on: November 27, 2008, 04:34:53 am »
Im wondering, if theres a way to execute a command and then add a delay so 25 seconds later or so. your killed on the spot with something like DoDamage? Is this possible.

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: Delay
« Reply #1 on: November 27, 2008, 05:14:52 pm »
http://forums.soldat.pl/index.php?topic=29911.0
Is that what you were looking for?

Offline Surfzy

  • Major(1)
  • Posts: 9
  • Living the life
Re: Delay
« Reply #2 on: November 27, 2008, 11:38:49 pm »
Not quite. im looking for a way to set a delay as if. you spawned a Predator pack, and after the 25 seconds was up it would kill you instantly. :S not quite sure on how to do it.

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Delay
« Reply #3 on: November 28, 2008, 12:08:28 am »
Not quite. im looking for a way to set a delay as if. you spawned a Predator pack, and after the 25 seconds was up it would kill you instantly. :S not quite sure on how to do it.
read Part IV: A Timer

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: Delay
« Reply #4 on: November 28, 2008, 01:15:42 am »
Not quite. im looking for a way to set a delay as if. you spawned a Predator pack, and after the 25 seconds was up it would kill you instantly. :S not quite sure on how to do it.
To walk you through what would happen in your program:

1. Give person, well call him ID, a predator kit. Use GiveBonus instead of SpawnObject btw. At the same time as you do this, set a global variable called Timer to 25.
2. Every second (AppOnIdle), remove 1 from Timer.
Check if Timer is equal to 0.
If it is: kill player ID.
If it is NOT: do nothing!

If you need further help just PM me on IRC.