Home   Help Search Login Register  

Author Topic: seting dammage to all units in a vehicle  (Read 650 times)

0 Members and 1 Guest are viewing this topic.

gadolinite

  • Guest
seting dammage to all units in a vehicle
« on: 13 Jun 2003, 07:35:14 »
how would you setdammage to everyone inside any vehicle when they enter a trigger area?

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:seting dammage to all units in a vehicle
« Reply #1 on: 13 Jun 2003, 08:11:19 »
"_X setdammage 1" foreach crew vehiclename

in da on activision of da triger

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

gadolinite

  • Guest
Re:seting dammage to all units in a vehicle
« Reply #2 on: 13 Jun 2003, 19:47:01 »
 :-Xsome of the vehicles don't have names, also <any> vehicle with a name has to be effected

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:seting dammage to all units in a vehicle
« Reply #3 on: 13 Jun 2003, 20:23:18 »
name em :P ;)

nd put line 4 every vehicle

or...

u can make array of all vehicles nd do loop w/ dat line  ;D

somin like (lets name da array _vehs ;D)

Code: [Select]
_count = count _vehs
_i = 0
#loop
_veh = _vehs select _i
"_X setdammage 1" foreach crew _veh
_i = _i+1
? _i < _count : goto "loop
exit

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

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:seting dammage to all units in a vehicle
« Reply #4 on: 14 Jun 2003, 02:41:02 »
I'd really go with querying if vehicle (list thatlist select _N) != (list thatlist select _N), so he must be in a vehicle. That will surely affect anyone in the list. So set the trigger up as usual to trigger on anyone and on activ:
[] exec "belowscript.sqs"

Code: [Select]
_thatmax = (count list thatlist)-1
_t = 0
#thatloop
? (vehicle (list thatlist select _t)) != (list thatlist select _t) : (list thatlist select _t) setDammage (getDammage  (list thatlist select _t) + .05)
~.1
? (_t <= _thatmax) : _t = _t + 1; goto "thatloop"

I'm sure if that works it's the shortest way. O n dat adds to the damage they got, not sure if you want that but you know what to do, don't you?
If you have many of these triggers, you can try passing the list name into that script to avoid creating multiple script for 1 purpose.
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.