Ollie G 0 Report post Posted January 13, 2017 (edited) Hello there, Can anyone help with this? I'm trying to give the player's more health because A.I one shot us unless i make the A.I shoot like a retard with [["aimingAccuracy",0.002] hahaha So all we want is the fight to last a little longer instead of keep reviving each other, We have a server, I have tryed a few things like: Eden Editor: In the player (Green) init i have tryed Unit addEventHandler ["HandleDamage", {false}]; Unit addEventHandler ["Hit", {Unit setDamage (0.02 + getDammage Unit)}]; and in Infistar: useCustomHandeDamageHandler = "True"; also i have tryed the next 3 initPlayerLocal.sqf: --------------------------------------------------- 1 -------------------------------------------------------------- this addEvntHandler ["HandleDamage", { _unit = _this select 0; _selection = _this select 1; _damagee = _this select 2; if (_selection == "?") exitWith {}; _curDamage = damage _unit; if (_selection != "") then {_curDamage = _unit getHit _selection}; _newDamage = _damage - _curDamage; _damage - _newDamage * 0.75 }]; --------------------------------------------------- 2 -------------------------------------------------------------- //Only damage from last applied handleDamage EH is taken into consideration by the engine //Apply a new EH so as we can override the damage applied _unit addEventHandler [ "HandleDamage", { params ["_unit", "_selection", "_damage","_source","","_index"]; systemChat format[ "Damage recieved: %1", _damage ]; //Do any other damage calculations here //_damage is the total damage the unit has for this selection once this EH returns //e.g lets change the damage recieved for each selection if ( _index > -1 ) then { private _selectionDamage = _unit getHit _selection; private _damageRecieved = (_damage - _selectionDamage) max 0; _damageRecieved = _damageRecieved / 100; _damage = _damageRecieved + _selectionDamage; }; systemChat format[ "Damage to REVIVE: %1", _damage ]; //Only players respond to REVIVE if ( isPlayer _unit ) then { _this set[ 2, _damage ]; //Call BI REVIVE HandleDamage EH passing new _damage value _damage = _this call BIS_fnc_reviveOnPlayerHandleDamage; }; systemChat format[ "Damage to engine: %1", _damage ]; _damage }]; systemChat format[ "Override REVIVE EH applied to %1", _unit ]; --------------------------------------------------- 3 -------------------------------------------------------------- this addeventhandler ["HandleDamage", { private ["_return"]; _unit = _this select 0; _selection = _this select 1; _passedDamage = _this select 2; _source = _this select 3; _projectile = _this select 4; _oldDamage = 0; _bodyMultiplier = 0; _legsMultiplier = 0.25; _handsMultiplier = 0.25; _headMultiplier = 0.75; _overAllMultiplier = 0.25; switch (_selection) do { case("head") : { _oldDamage = _unit getHitPointDamage "HitHead"; _return = _oldDamage + ((_passedDamage - _oldDamage) * _headMultiplier); }; case("body") : { _oldDamage = _unit getHitPointDamage "HitBody"; _return = _oldDamage + ((_passedDamage - _oldDamage) * _bodyMultiplier); }; case("hands") : { _oldDamage = _unit getHitPointDamage "HitHands"; _return = _oldDamage + ((_passedDamage - _oldDamage) * _handsMultiplier); }; case("legs") : { _oldDamage = _unit getHitPointDamage "HitLegs"; _return = _oldDamage + ((_passedDamage - _oldDamage) * _legsMultiplier); }; case("") : { _oldDamage = damage _unit; _return = _oldDamage + ((_passedDamage - _oldDamage) * _overAllMultiplier); }; default{}; }; _return }]; has anyone done this yet? because i can't find much on player health so hopefully someone can help Please Edited January 13, 2017 by Ollie G command Texts are a little messed up lol Share this post Link to post Share on other sites
screenracer 0 Report post Posted September 7, 2017 (edited) I would also like to know how to do this. I think the damage is dealt through ExileClient_object_player_event_onHit? I think by changing this private["_damage"]; _damage = _this select 2; if !(ExilePlayerInSafezone) then { [_damage * 10] call BIS_fnc_bloodEffect; ExileClientPlayerIsInCombat = true; ExileClientPlayerLastCombatAt = diag_tickTime; true call ExileClient_gui_hud_toggleCombatIcon; }; true to private["_damage"]; _damage = _this select 2; if !(ExilePlayerInSafezone) then { [_damage * 1] call BIS_fnc_bloodEffect; ExileClientPlayerIsInCombat = true; ExileClientPlayerLastCombatAt = diag_tickTime; true call ExileClient_gui_hud_toggleCombatIcon; }; true then that would make players take less damage? Haven't been able to test it yet though. Update: Nope, doesn't seem to work. I'm not sure where exile handles damage, but I would really like to be able to not get one shotted by ai as well. (I run a private server with friends and we're kinda tired of reviving each other all the time) Edited September 11, 2017 by screenracer Share this post Link to post Share on other sites