Jump to content
Sign in to follow this  
frosties

deleteVehicle based upon vehicles death

Recommended Posts

Hello, 

 

Working on my MHQ script for my mission.

 

Got almost everything working as i want it to, except for when the FOB vehicle is destroyed when being deployed.

The issue then is that the camou net and flagpole is still deployed after the vehicle has respawned.

 

The script for Packing the FOB is using
 

deleteVehicle (_FOB getVariable "CAMONET");
deleteVehicle (_FOB getVariable "FLAGPOLE");

To remove the netting and flag when being packed, but i cannot get this to work upon respawn of the FOB. Trying with a trigger using !alive but cant get the On Activation setup properly.

Share this post


Link to post
Share on other sites

You could try this:

addMissionEventHandler ["EntityRespawned", {
	params ["_new","_old"];
	_camonet = _old getVariable["CAMONET",objNull];
	_flagpole = _old getVariable["FLAGPOLE",objNull];
	if (!isNull _camonet) then {
		deleteVehicle _camonet;
	};
	if (!isNull _flagpole) then {
		deleteVehicle _flagpole;
	};
	deleteVehicle _old;
}];

There may be better solutions but that would require more details about the scripts at play.

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  

×