Home   Help Search Login Register  

Author Topic: More conditions for "waituntil"  (Read 1215 times)

0 Members and 1 Guest are viewing this topic.

Offline AA_Chriss

  • Members
  • *
More conditions for "waituntil"
« on: 23 Nov 2008, 17:22:22 »
Hello, is it possible to have more conditions for a "waituntil"?
I have made a little airtaxi script for my mission and it waits until the crew count is great than "1".
However when there is no player getting in, i want to let it fly away after 5 minutes even when no-one is getting in.

So can i make 2 conditions for waituntil?
If so, how?

Thanks very much!

Offline T_D

  • CWR
  • **
  • Troubleshooting Device
Re: More conditions for "waituntil"
« Reply #1 on: 23 Nov 2008, 17:30:18 »
Code: [Select]
_startTime = time;
waitUntil
{
_cond1 = count crew heli > 1;
_cond2 = time - _startTime > 5*60;
_cond1 || _cond2
};

This basically means: waitUntil _cond1 or _cond2 is true.

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: More conditions for "waituntil"
« Reply #2 on: 24 Nov 2008, 07:02:23 »
also try:
Code: [Select]
_startTime = time;
waitUntil
{
_cond1 = count crew heli > 1;
_cond2 = time - _startTime > 5*60;
_cond1 && _cond2
};

To wait till both are true.

Luke
Pesky Human!!
Wort Wort Wort.