Home   Help Search Login Register  

Author Topic: count units  (Read 703 times)

0 Members and 1 Guest are viewing this topic.

Ryu

  • Guest
count units
« on: 04 Jan 2004, 05:23:24 »
This is a simple script, hard for me ???

I need a script which counts the units in a team then depending on the number starts a scrip.

If the number is <=4 no action
                          >=5 start script A
                          >=8 start script B

If someone could write this it would be a help.

Cheers

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:count units
« Reply #1 on: 04 Jan 2004, 12:51:16 »
Code: [Select]
_group = group (_this select 0)

? count units _group >= 8 : [] exec "sciptb"
? count units _group >= 5 : [] exec "scipt1"

exit

or u can make a loop instead of exitin da script

exec

[unitfromgroup] exec "scriptname.sqs"

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Ryu

  • Guest
Re:count units
« Reply #2 on: 04 Jan 2004, 13:57:04 »
Thanks, 1 other thing is it possible to have
">=5 but not >=9 exec scriptA"

I want to run a script with players between 5 and 8 only.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:count units
« Reply #3 on: 04 Jan 2004, 16:03:48 »
Thanks, 1 other thing is it possible to have
">=5 but not >=9 exec scriptA"

I want to run a script with players between 5 and 8 only.

Then u launch scipt1 in LCD's script. Under 5 nothing happens.

:beat: *Gets Shot* :beat:

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:count units
« Reply #4 on: 04 Jan 2004, 16:17:51 »
Possibly:

? (count units _group >= 5) && (count units _group <=8): [] exec "scipt1"

or something similar.


Planck
I know a little about a lot, and a lot about a little.

Ryu

  • Guest
Re:count units
« Reply #5 on: 05 Jan 2004, 05:39:04 »
Thanks, that's enough to do what I want ;)