View Full Version : Invulnerable

Feb 20 2006, 13:52
Is there a way to make a unit invulnerable?

Feb 20 2006, 14:25
Not really.
This function has been removed from OFP to prevent people from using cheats. You can try to use a workaround though.
Setup a looped script that will use the command "setdammage 0" over and over again for a specific unit. If a unit receives damage >= 1 by anything the script will fail though.
So basically there is no real solution to your problem.

Feb 20 2006, 14:47
Thanks anyway. I guess I'll just have to keep them alive some other way.

Feb 20 2006, 14:49
If you donĀ“t want to have them targetted use "unitname setcaptive true" in their init.
You can change that later on by using a trigger and use "unitname setcaptive false" in the OnActivation

Feb 20 2006, 15:02
player addeventhandler ["hit",{player setdammage 0}]
player addeventhandler ["dammaged",{player setdammage 0}]

Feb 21 2006, 19:18
EDIT: Thanks for correction InqWiper

Feb 21 2006, 19:22
Less beliefs and more tries. It takes less than 2 minutes to go into OFP and try it. No reason to say you dont think it works. It does work, Ive used it several times. I have never died with those 2 eventhandlers.

Feb 22 2006, 15:58
But if you get wacked by a headshot, you should stay dead. Right?

Feb 22 2006, 16:31
Right. So IMHO such commands are meant to be used only for the in-mission cutscenes or something similar; whenever the player needs to stay alive 'at all costs', not in some (serious) mission.