OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: punisher on 06 Sep 2011, 22:30:04

Title: Seting a vehicles speed
Post by: punisher on 06 Sep 2011, 22:30:04
hi
How do you limit a vehicles speed to a set value? I have a chopper flying low and with the speed to limitied to allow the men to jump out into the water. However sometimes it goes to fast resulting in death, thats why a number value would be better.
Title: Re: Seting a vehicles speed
Post by: F2kSel on 07 Sep 2011, 00:08:33
try placing this in the waypoint where you want the heli to slow, name the chopper heli. You can set the speed by changing the value currently 10.

Code: [Select]
null  = [heli,10] spawn {_air = _this select 0;_speed = _this select 1;airslow = true;while {alive _air and airslow} do {_air limitSpeed _speed;sleep 0.1;};};

when you want it to resume normal speed just place this in the next waypoint or trigger  
Code: [Select]
airslow = false