OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: ZapBrannigan on 30 Jul 2007, 04:04:59
-
I need the lines of code that will genrate explossions in a radius of 30 meters out from an object. I need to be able to put it in a script. I just forgot how to do that part. Thanks
-
// Bomb_area.sqf
//
// nil = [vehicle player, 2, 30, 60, 5, 15]execVM "Bomb_area.sqf"
_object = _this select 0;
_maxdelay = _this select 1;
_min_radius = _this select 2;
_max_radius = _this select 3;
_min_explosions = _this select 4;
_max_explosions = _this select 5;
_nexplosions = _min_explosions + random (_max_explosions - _min_explosions);
for [{_i=0},{_i < _nexplosions},{_i = _i + 1}] do
{
_rad = _min_radius + random (_max_radius - _min_radius);
_ang = random 360;
_bomb = "Bomb" createVehicle [(getPos _object select 0)+sin(_ang)*_rad, (getPos _object select 1)+cos(_ang)*_rad, 0];
_bomb setDamage 1;
Sleep (0.5 + random _maxdelay);
};
-
Excelent, thank you