OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: nimierkki on 24 Jun 2006, 14:43:51

Title: Immortal plane
Post by: nimierkki on 24 Jun 2006, 14:43:51
Do anyone know how to do Immortal plane?? thx sorry my english
Title: Re: Immortal plane
Post by: Mandoble on 24 Jun 2006, 15:02:01
You may try to write the following into the plane's INIT field:
Code: [Select]
this addeventhandler ["Hit",{(_this select 0) setdammage 0;driver (_this select 0) setdammage 0;gunner (_this select 0) setdammage 0}]
Title: Re: Immortal plane
Post by: nimierkki on 24 Jun 2006, 15:08:36
how i make the passinger immortal at the plane too??
in the goud they can die

ilke inthe plane tay cant die but when they jumped off they can die
Title: Re: Immortal plane
Post by: SniperAndy on 25 Jun 2006, 12:41:24
Code: [Select]
setdammage 0;cargoI think...
Title: Re: Immortal plane
Post by: h- on 25 Jun 2006, 13:52:40
Quote
setdammage 0;cargo

I think...
Not exactly...
Code: [Select]
"_x setDamage 0" forEach (cargo nameoftheplane)OFP sqs code is not exactly OOP :P


But to answer the immortal passengers thing, you would need to add that same eventHandler for them as you add for the plane..
So try putting the following in the plane's init field:

this addEventHandler ["hit",{(_this select 0) setdammage 0; {_x setDamage 0} forEach (crew (_this select 0) )}]; {_x addEventHandler ["hit",{ (_this select 0) setDamage 0}]} forEach (crew this)

(sorry, no code tags because they screw up that line for some reason..)

Or something like that..
Not tested at all so no guarantees it works.. ;)