Jump to content
Sign in to follow this  
Somerville

Making a Unit Invincible

Recommended Posts

Hi,

I'm trying to make some units invincible, so that players can't ruin the game for other players. So far I've tried putting this in the init line for units I don't want to die:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addeventhandler ["hit", {_this select 0 setdamage 0}];

But that's not working with all of them. Some are just normal civilians, but they still die with this in the init line. Does anyone have any suggestions on alternatives, or why this current approach isn't working?

Share this post


Link to post
Share on other sites

You also need to include a "damaged" event handler to be failsafe.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler ["dammaged",{(_this select 0) setDamage 0}]; this addEventHandler ["hit",{(_this select 0) setDamage 0}];

Although, some instant kills (headshots and possibly large explosions) may still not prevent death.

Lots of threads on the topic. Just enter invincible as the search term, ArmA Editing in the forums selector, and search from this year.

Good luck!

Share this post


Link to post
Share on other sites

I've had ArmA crash when using multiple EV for this purpose, and being sustained to large amounts of enemy fire.

Share this post


Link to post
Share on other sites

setdammage -500 works better, completely invincible. (Ty to Wolfrug for teaching me this rofl.gif )

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  

×