gc8 970 Posted August 2, 2019 Thought this was something simple and what I have done before but I cannot make the plane invulnerable My code: (vehicle player) addEventHandler ["HandleDamage", { params ["_veh","_section","_damage","_unit","_cause"]; _dam = 0; _dam }]; But the plane I'm flying explodes on too hard ground impact I dont want to use allowdamage because eventually I want to reduce the damage not completely remove any ideas? thx! Share this post Link to post Share on other sites
GEORGE FLOROS GR 4206 Posted August 2, 2019 Hello there gc8 ! Have you read this ? On 6/5/2017 at 7:22 PM, ShadowRanger24 said: How to prevent the unit from taking damage completely: _unit addEventHandler ["HandleDamage", {0}]; 1 Share this post Link to post Share on other sites
ZaellixA 383 Posted August 2, 2019 Hey GEORGE FLOROS GR, to be honest I did read this and after some testing (was trying to find a way to help here) I realized that this is NOT a solution. I also tried with setHit, setDamage (which I am not sure makes sense but tried it anyway) and setHitPointDamage and none made the job...!!! I am not sure why this is happening as, to my understanding, at least the setHit and setHitPointDamage should do the job (the HandleDamage event handler provides enough to be able to use them). I do hope someone will shed some light here as, despite the fact that I am not directly interested in the solution, I am indeed intrigued by the fact that those commands "do not work" (forgive the abuse of phrase here). 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4206 Posted August 2, 2019 23 minutes ago, ZaellixA said: Hey GEORGE FLOROS GR, to be honest I did read this and after some testing (was trying to find a way to help here) I realized that this is NOT a solution. I think that i'll give it a try ! So we want to handle the vehicle damage right ?! Let's see ! Share this post Link to post Share on other sites
GEORGE FLOROS GR 4206 Posted August 3, 2019 (edited) I think that it's working this way : Ps is 4:00 in the morning ! I can't test this further ! GF_HD_HitPart = { _this addEventHandler ["HitPart", { (_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"]; // [_target,false]remoteExec["allowDamage",_target]; _damage = damage _target; systemchat format ["_damage %1",_damage]; if!(_target getVariable ["Var_GF_HD_HitPart_EH",false])then{ _new_damage = _damage / 2; _target setDamage _new_damage; systemchat format ["setDamage %1",_new_damage]; _target setVariable ["Var_GF_HD_HitPart_EH",true]; }; }]; }; []spawn{ while{true}do{ waitUntil{uisleep 1; { if( (alive _x) && (!(_x getVariable ["Var_GF_HD_HitPart",false])) )then{ _x spawn GF_HD_HitPart; }; _x setVariable ["Var_GF_HD_HitPart",true]; }forEach vehicles; }; }; }; Edited August 3, 2019 by GEORGE FLOROS GR ...4:38 the code is wrong , good night guys ! Share this post Link to post Share on other sites
GEORGE FLOROS GR 4206 Posted August 3, 2019 ...4:38 the code is wrong , good night guys ! 1 Share this post Link to post Share on other sites
gc8 970 Posted August 3, 2019 Thanks guys. I'd say the eventhandler is buggy since returning always zero from there doesn't make the vehicle invulnerable. "allowDamage false" does (Or setting that from editor at least) 2 Share this post Link to post Share on other sites