Hier eine überarbeitete Variante des scriptes das jetzt als Funktion funktioniert.
In der descripton.ext wird der Funktion ein Nahme gegeben
C: fixbloodloss.sqf
- ////////////////////////
- //Author Denki
- // Example:
- // [player] call fix_fnc_bloodloss
- // For ACE 3.13.x and upward. If the player blood volume falls under 3.5l the function prevents it from falling any further.
- // and preventing death by blood loss.
- ////////////////////////
- #include "\z\ace\addons\main\script_mod.hpp"
- #include "\z\ace\addons\medical_engine\script_macros_medical.hpp"
- #include "\z\ace\addons\main\script_macros.hpp"
- #include "\x\cba\addons\xeh\script_xeh.hpp"
- #include "\x\cba\addons\main\script_macros_common.hpp"
- params [["_unit", objNull, [objNull]]];
- private _bloodVolume = _unit getVariable[VAR_BLOOD_VOL,6.0];
- if (_bloodVolume < 3.5) then
- {
- _unit setVariable [VAR_BLOOD_VOL, 3.5];
- };
An der Funktion hat sich nicht viel geändert.
Der Aufruf ist etwas ander dadurch das wir die Funktion jetzt Aufrufen und nicht mehr das Script.