Jump to content
avibird 1

Need help to prevent AI from dying due to lack of Oxygen

Recommended Posts

I have this code snippet in initPlayerLocal.sqf

addMissionEventHandler ["EachFrame",{if (getOxygenRemaining foreach player < 0.1) then { player setOxygenRemaining 0.1}}];

this prevents players from dying under water when swimming or incapacitated. 

 

 

I attempted to add this code to initserver.sqf

addMissionEventHandler ["EachFrame",{if (getOxygenRemaining foreach allunits < 0.1) then {foreach allunits setOxygenRemaining 0.1}}];

to prevent the stupid AI from killing themself when swimming under water SMH. 

Share this post


Link to post
Share on other sites

The code in red appears to be working now for the AI units.  I need to adjust the order in the initserver.sqf. 

  • Like 1

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

×