Jump to content
Sign in to follow this  
On_Sabbatical

Exploding an ammo at a certain range < maxRange

Recommended Posts

I am trying to edit this script from Warfare Benny,to make the missile explode when _limit is reached instead of getting deleted without any explosion !

Private ["_ammo","_irLock","_missile","_source","_unit"];
_unit = _this select 0;
_ammo = _this select 1;
_source = _this select 2;

_missile = nearestObject [_source,_ammo];
if (isNull _missile) exitWith {};

//--- Get the ammo type.
_irLock = getNumber(configFile >> "CfgAmmo" >> _ammo >> "irLock");

//--- IR Lock is affected
if (_irLock == 1) then {
_distance = _unit distance _source;

_limit = 'WFBE_INCOMINGMISSILEMAXRANGE' Call GetNamespace;

if (_distance > _limit) then {
	waitUntil {_missile distance _source > _limit};
	deleteVehicle _missile;
};

};

Share this post


Link to post
Share on other sites

I think Zodd's script sounds rather like what you need (assuming it's for player(s)) - works very well for HEDP.

http://forums.bistudio.com/showthread.php?134353-ZSU_HEDP_Airburst-V1&p=2149901#post2149901

If it's for a different type of missile, you'll need ask Zodd if you might adapt his code. Very decent chap, so he may well agree.

Share this post


Link to post
Share on other sites

Need to get an object to hit the ammo,but script lag make it a bit difficult not to see the object

EDIT:

I've done it this way :

Deleted my rocket,created a vehicle called "bomb" (check cfgvehicles) then setdamage to the vehicle and boom :D

You can play with the epicness of the explosion using setFuel ;)

Edited by On_Sabbatical

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×