Jump to content
Sign in to follow this  
cody4651

Respawning with Scripts

Recommended Posts

Hello, I am using the following support scripts.

Air support

Arty

They work very well, but I have found a problem. When the character that has the scripts attached to them dies and respawns the supports can not be used. I searched for another topic like this ,but could not find one. Does anyone know how to fix this?

Share this post


Link to post
Share on other sites

Hi...maybe something like this in a little script....simply called check.sqf here. It loops forever as long as the mission is active and should do what you need.

"check.sqf"

while {true} do {
    waituntil {not alive _dude};
    waituntil {alive _dude};

    [i][color="Red"]run your scripts here....[/color][/i]

};

One way to execute it would be from the Init line of the _dude, player....or whoever with :-

nul = [this] execVM "check.sqf";

Hope it works for you. I don't use those scripts so don't know if other code is needed in order to make them work. Good luck!

Share this post


Link to post
Share on other sites

addeventhandler respawn which runs a script that readds the actions.

Share this post


Link to post
Share on other sites
addeventhandler respawn which runs a script that readds the actions.

Thanks for posting that. Never knew it even existed! I have changes to make :)

Share this post


Link to post
Share on other sites

shk where would i add that to? the init line on the unit? im new to this scripting stuff.

Share this post


Link to post
Share on other sites

Init field for example. Something like this:

this addeventhandler ["respawn","_this execvm 'respawn.sqf'"];

respawn.sqf:

_newunit = _this select 0;
_newunit addaction [...];

Share this post


Link to post
Share on other sites

This worked, but it only lets me use the open and close menu and not the ability to choose the mission type and etc. That is the init line from the mission.sqm file.

init="this addWeapon ""LaserDesignator""; this addMagazine ""LaserBatteries""; arty_radio = [this] execvm ""artillery_ssp\arty_radio.sqf""; this addeventhandler [""respawn"",""_this execVM 'respawn.sqf'""];";

It did not do anything for the air support. Really all you have to do for that is just put m1 in the name section and create heli pad with ASPad.

Edited by cody4651
Just checked how it did with the airsupport.

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  

×