OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: izaktj on 15 Dec 2008, 13:52:22

Title: {_x animate [animationname, 1]}foreach units group this not working on vehicle.
Post by: izaktj on 15 Dec 2008, 13:52:22
OK, I downloaded a police vehicle with sirens and light bar. The animation works for a single vehicle if I use
Code: [Select]
this animate ["ani_siren", 1];
However, if I select the teamleader and write:
Code: [Select]
{_x animate ["ani_siren", 1]} foreach units group thisIt doesn't work, I don't get an error message though, so I think it's caused because the unit itself refers to the driver not the vehicle. I suppose the is other word for it to work. Thanks for the help.
Title: Re: {_x animate [animationname, 1]}foreach units group this not working on vehic
Post by: bedges on 15 Dec 2008, 14:04:05
Almost there I think:

Code: [Select]
{(vehicle _x) animate ["ani_siren", 1]} foreach units group this
Untested.
Title: Re: {_x animate [animationname, 1]}foreach units group this not working on vehic
Post by: izaktj on 15 Dec 2008, 14:24:13
Works like a charm! Thanks!