Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Pay for healing v.2
- // Author: GaspArt aka SixPeso
- // Special thanks to Axeman for correction of errors.
- private ["_needAntibiotics","_needBandage","_needPainkiller","_needBloodbag","_needMorphine","_costEtc","_costBandage","_costAntibiotics","_costPainkiller","_costBloodbag","_costMorphine","_array","_unit","_medic","_costInstantHeal","_notEnough","_cashmoney"];
- disableserialization;
- _array = _this;
- _unit = _array select 0;
- _medic = _array select 1;
- _needAntibiotics = 0;
- _needBandage = 0;
- _needBloodbag = 0;
- _needMorphine = 0;
- _needPainkiller = 0;
- //////////////////
- /*Configs Start */
- //////////////////
- _instantHeal = false; // If you want to heal player in one action set True, if you want to heal only player's damaged parts of body set False.
- _costInstantHeal = 1000; //Works only if instantHeal = true
- //Configs if _instantHeal = False;
- //Price list:
- _costAntibiotics = 111;
- _costBandage = 222;
- _costPainkiller = 333;
- _costBloodbag = 444;
- _costMorphine = 555;
- _costEtc = 666; //paying for food,drink, disabling camerashake, heatpack and another not valuable parameters.
- //////////////////
- /* Configs End */
- //////////////////
- if (_unit == player) then {
- //unit = player
- _cashMoney = player getVariable["cashMoney",0]; //getting cash
- if (_instantHeal) then { //instantHeal = true
- if (_cashmoney < _costInstantHeal) then {
- _notEnough = _costInstantHeal - _cashMoney;
- [format["<t size='1.2' color='#D01000'>Dear %1</t><br/><t size='0.9'>you need %2 coins more to pay for treatment.</t>",(name player),(_notEnough)],0,0,2,2] spawn BIS_fnc_dynamicText;
- } else {
- //Paying for instant healing
- _cashMoney = _cashMoney - _costInstantHeal;
- player setVariable ["cashMoney", _cashMoney , true];
- [format["<t size='1.2' color='#018E0B'>Dear %1</t><br/><t size='0.9'>you were completely cured. You spent 2% coins.</t>",(name player),(_costInstantHeal)],0,0,2,2] spawn BIS_fnc_dynamicText;
- //Instant healing start
- disableSerialization;
- dayz_sourceBleeding = objNull;
- r_player_blood = r_player_bloodTotal;
- r_player_inpain = false;
- r_player_infected = false;
- r_player_injured = false;
- dayz_hunger = 0;
- dayz_thirst = 0;
- dayz_temperatur = 37;
- r_fracture_legs = false;
- r_fracture_arms = false;
- r_player_dead = false;
- r_player_unconscious = false;
- r_player_loaded = false;
- r_player_cardiac = false;
- r_player_lowblood = false;
- r_player_timeout = 0;
- r_handlercount = 0;
- r_interrupt = false;
- r_doLoop = false;
- r_drag_sqf = false;
- r_self = false;
- r_action = false;
- r_action_unload = false;
- r_player_handler = false;
- r_player_handler1 = false;
- disableUserInput false;
- 'dynamicBlur' ppEffectAdjust [0];
- 'dynamicBlur' ppEffectCommit 5;
- _selection = 'legs';
- _damage = 0;
- player setHit[_selection,_damage];
- player setVariable['messing',[dayz_hunger,dayz_thirst],true];
- player setVariable['NORRN_unconscious',false,true];
- player setVariable['USEC_infected',false,true];
- player setVariable['USEC_injured',false,true];
- player setVariable['USEC_inPain',false,true];
- player setVariable['USEC_isCardiac',false,true];
- player setVariable['USEC_lowBlood',false,true];
- player setVariable['USEC_BloodQty',12000,true];
- player setVariable['unconsciousTime',0,true];
- player setVariable['hit_legs',0,true];
- player setVariable['hit_hands',0,true];
- player setVariable['medForceUpdate',true,true];
- _display = uiNameSpace getVariable 'DAYZ_GUI_display';
- _control = _display displayCtrl 1303;
- _control ctrlShow false;
- _display = uiNameSpace getVariable 'DAYZ_GUI_display';
- _control = _display displayCtrl 1203;
- _control ctrlShow false;
- player setdamage 0;
- 0 fadeSound 1;
- resetCamShake;
- // Instant healing end
- };
- } else { //instantHeal = false
- if (r_player_injured) then {_costEtc = _costEtc + _costBandage; _needBandage = 1;}; //check for bleeding
- if (r_player_blood < 12000) then {_costEtc = _costEtc + _costBloodbag; _needBloodbag = 1;}; //check for less blood
- if (r_fracture_legs) then {_costEtc = _costEtc + _costMorphine; _needMorphine = 1;}; //check for broken legs
- if (r_player_inpain) then {_costEtc = _costEtc + _costPainkiller; _needPainkiller = 1;}; //check for pain
- if (r_player_infected) then {_costEtc = _costEtc + _costAntibiotics;_needAntibiotics =1;}; //check for infection
- if (_cashmoney < _costEtc) then {
- _notEnough = _costEtc - _cashMoney;
- [format["<t size='1.2' color='#D01000'>Dear %1</t><br/><t size='0.9'>you need %2 coins more to pay for treatment.</t>",(name player),(_notEnough)],0,0,2,2] spawn BIS_fnc_dynamicText;
- } else {
- //Paying for healing
- _cashMoney = _cashMoney - _costEtc;
- player setVariable ["cashMoney", _cashMoney , true];
- [format["<t size='1.2' color='#018E0B'>Dear %1</t><br/><t size='0.9'>you were completely cured. You spent %2 coins.</t>",(name player),(_costEtc)],0,0,2,2] spawn BIS_fnc_dynamicText;
- if (_needBloodbag == 1) then {
- r_player_blood = r_player_bloodTotal;
- player setdamage 0;};
- if (_needPainkiller == 1) then {
- r_player_inpain = false;
- player setVariable['USEC_inPain',false,true];};
- if (_needAntibiotics == 1) then {
- r_player_infected = false;
- player setVariable['USEC_infected',false,true];};
- if (_needBandage == 1) then {
- r_player_injured = false;
- player setVariable['USEC_injured',false,true];
- dayz_sourceBleeding = objNull;};
- if (_needMorphine == 1) then {
- r_fracture_legs = false;
- r_fracture_arms = false;
- _selection = 'legs';
- _damage = 0;
- player setHit[_selection,_damage];
- player setVariable['hit_legs',0,true];
- player setVariable['hit_hands',0,true];};
- disableSerialization;
- dayz_hunger = 0;
- dayz_thirst = 0;
- dayz_temperatur = 37;
- r_player_dead = false;
- r_player_unconscious = false;
- r_player_loaded = false;
- r_player_cardiac = false;
- r_player_lowblood = false;
- r_player_timeout = 0;
- r_handlercount = 0;
- r_interrupt = false;
- r_doLoop = false;
- r_drag_sqf = false;
- r_self = false;
- r_action = false;
- r_action_unload = false;
- r_player_handler = false;
- r_player_handler1 = false;
- disableUserInput false;
- 'dynamicBlur' ppEffectAdjust [0];
- 'dynamicBlur' ppEffectCommit 5;
- player setVariable['messing',[dayz_hunger,dayz_thirst],true];
- player setVariable['NORRN_unconscious',false,true];
- player setVariable['USEC_isCardiac',false,true];
- player setVariable['USEC_lowBlood',false,true];
- player setVariable['USEC_BloodQty',12000,true];
- player setVariable['unconsciousTime',0,true];
- player setVariable['medForceUpdate',true,true];
- _display = uiNameSpace getVariable 'DAYZ_GUI_display';
- _control = _display displayCtrl 1303;
- _control ctrlShow false;
- _display = uiNameSpace getVariable 'DAYZ_GUI_display';
- _control = _display displayCtrl 1203;
- _control ctrlShow false;
- 0 fadeSound 1;
- resetCamShake;
- };
- };
- } else {
- //unit != player
- ["<t size='1.0' color='#C38101'>You are not a player! O_o </t>",0,0,2,2] spawn bis_fnc_dynamicText;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement