Jump to content
Sign in to follow this  
mpreuett

Add Action after vehicle respawn

Recommended Posts

Hi Folks,

I have an issue that I am trying to solve. I have two C130's that I have the following as the init:

veh=[this] execVM "vehicle.sqf";this addaction ["Bombs Away!","carpet.sqf"];

These are the vehicle respawn and carpet bomb action. Everything works fine on the initial load, but when these two respawn, the carpetbomb action doesn't get readded. I'm looking for a way to have the action readded after a respawn. I see the following lines in the vehicle.sqf file:

if (_haveinit) then

{_unit setVehicleInit format ["%1;", _unitinit];

processInitCOmmands;};

if (_hasname) then

{_unit setVehicleInit format ["%1 = this; this setVehicleVarName ""%1""",_unitname];

processInitCommands;};

I'm not quite sure of the syntax, but I think this is where I need to add some scripting to add the action back on respawn based on the unit name. The two unitnames are c130 and c130_1.

Anyone have any suggestions on how to accomplish?

Thanks in advance.

Share this post


Link to post
Share on other sites

Tophe's Simple Vehicle Respawn Script has a feature for keeping init lines, you could use that.

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  

×