OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: gadolinite on 13 Jun 2003, 07:35:14
-
how would you setdammage to everyone inside any vehicle when they enter a trigger area?
-
"_X setdammage 1" foreach crew vehiclename
in da on activision of da triger
LCD OUT
-
:-Xsome of the vehicles don't have names, also <any> vehicle with a name has to be effected
-
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)
_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
-
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"
_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.