OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: beefhole1 on 23 Jan 2005, 07:03:22

Title: killing a unit after a certain time
Post by: beefhole1 on 23 Jan 2005, 07:03:22
I'm making a mission where you are a counter sniper protecting the president of nogova, and it's all done except I need the president to die after, say five minutes or so. I can't get the russian sniper to do it, he's too far away. Is there anyway to have a unit just die after a certain amount of time?
Title: Re:killing a unit after a certain time
Post by: Homefry31464 on 23 Jan 2005, 07:16:17
You could just script it...

Call it mankill.sqs
_man = _this select 0
~(numberofminutes * 60)
_man setdammage 1
exit


Replace numberofminutes with however many minutes you want, or remove everything in the brakets and put in the amount of seconds you want.

Call the script by the man you want to kill... IE.

[manname] exec "mankill.sqs"
Title: Re:killing a unit after a certain time
Post by: dmakatra on 23 Jan 2005, 11:05:29
Or you can just do a trigger with 300 in countdown. ;)

:beat: *Gets Shot* :beat:
Title: Re:killing a unit after a certain time
Post by: Platoon Patton on 23 Jan 2005, 13:24:53
Trigger countdown 300 + introtime (if U use 1)

But isnt the command & usefull here?

Can someone explain how to use it in this example?
Title: Re:killing a unit after a certain time
Post by: beefhole1 on 23 Jan 2005, 16:26:24
Yes, examples are cool  ;)
Title: Re:killing a unit after a certain time
Post by: Homefry31464 on 23 Jan 2005, 17:09:53
Trigger countdown 300 + introtime (if U use 1)

But isnt the command & usefull here?

Can someone explain how to use it in this example?

Both me and Armty's examples work in these conditions, I'm rather confused why we need to use the & thing....
Title: Re:killing a unit after a certain time
Post by: Platoon Patton on 23 Jan 2005, 18:37:39
Waiting for a time: line starting with '&'.
    Example: &endTime is equivalent to @_time >= (endTime)

Just an idea,donno if this has advantages instead of ~

& is not much used in recent scripts,but it was in BIS missions.
Title: Re:killing a unit after a certain time
Post by: Homefry31464 on 23 Jan 2005, 19:02:57
Waiting for a time: line starting with '&'.
    Example: &endTime is equivalent to @_time >= (endTime)

Just an idea,donno if this has advantages instead of ~

& is not much used in recent scripts,but it was in BIS missions.


I see what you mean now.  Three ways to do the same thing... interesting.