private ["_bloodAmount","_humanityBool","_infectionChance","_humanityNegBool","_humanityNegAmount","_humanityAmount","_infectedLifeLost","_infectedLifeBool","_lastBloodbag","_bloodbagLastUsedTime","_bloodbagTime","_bloodbagUseTime","_bloodbagUsageTime","_HospitalDistance","_AmbulanceDistance","_Bloodmultiplier","_Infectionmultiplier","_Hospital_enable","_Ambulance_enable","_Anywhere_enable","_nearHospital","_playerASL1","_playerASLx","_playerASLy","_playerASLz","_playerASLz2","_playerASL2","_decke","_Hospitalfound","_Ambulancefound","_bloodAmount","_infectionChance"];
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Config Start-----------------------------------------------------------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
_bloodAmount = 4000; // Amount of blood to give to player
_bloodbagUseTime = 30; // Amount of time it takes in second for the player to use the self bloodbag
_bloodbagLastUsedTime = 60; // Amount of time in seconds before player can use self bloodbag again after a succesful use
_infectionChance = 10; // Percent chance of player infection on self bloodbag (10 = 10% | 2 = 50% | 1 = 100%)
_infectedLifeBool = true; // Whether the player can loose life if infected (True = On | False = off)
_infectedLifeLost = 1000; // Amount of life to loose in becomes infected
_humanityBool = false; // Whether the player can get humanity from giving self a bloodbag (True = On | False = off)
_humanityAmount = 50; // Amount of humanity to give player if _humanityBool is true (250 is default for normal bloodbags)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Config End-------------------------------------------------------------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
_HospitalDistance = 21; //Max distancewithin Hospital
_AmbulanceDistance = 5; // Max. Distance to get Ambulancebonus
_Bloodmultiplier = 1; // Blood amount multiplier (1 if not in Hospital or near Ambulance, 1.5 if near an Ambulance, 2 if near a Hospital, The Multiplier for Ambulance and Hospital get set later)
_Infectionmultiplier = 0.5; // Multiplier for infectionchance if in Hospital 0.5, 0.75 for an Ambulance, 1 if not in a Hospital (The higher the Value the lower the chance to get infected (it must never get 0 because of division by 0)
_Hospital_enable = 1; // 1 enables SelfBloodbag in Hospitals
_Ambulance_enable = 1; // 1 enables SelfBloodbag near Ambulances
_Anywhere_enable = 0; // 1 enables SelfBloodBag anywhere; (Turns automatically on if _Hospital_enable = 0 and _Ambulance_enable = 0;)
_nearHospital = false;
if ((_Hospital_enable == 0) && (_Ambulance_enable == 0)) then { // Check if _Hospital_enable & _Ambulance_enable disabled
_Anywhere_enable = 1;
};
if (_Anywhere_enable == 1) then {
_nearHospital = true;
};
if (_Hospital_enable == 1) then { // if Hospital enabled
_playerASL1 = getPosASL player;
_playerASLx = _playerASL1 select 0;
_playerASLy = _playerASL1 select 1;
_playerASLz = _playerASL1 select 2;
_playerASLz2 = _playerASLz + 40;
_playerASL2 = [_playerASLx,_playerASLy,_playerASLz2];
_decke = lineIntersects[_playerASL1,_playerASL2]; //überprüft ob sich zwischen dem Player und (Player+40m höhe) ein Objekt befindet (benötigt unbedingt ASL Koordinaten)
_Hospitalfound = count nearestObjects[player,["Land_A_Hospital","Land_A_GeneralStore_01","Land_a_stationhouse"],20]; // check if near Hospital
if ((_Hospitalfound > 0) && _decke) then {
_nearHospital = true;
_Bloodmultiplier = 2; // multiplier to Bloodamount
_Infectionmultiplier = 0.5; //multiplier to Infectionchance
};
};
if (_Ambulance_enable == 1) then {
_Ambulancefound = count nearestObjects[player,["GAZ_Vodnik_MedEvac","HMMWV_Ambulance"],_AmbulanceDistance]; // check if near Vodnik
if (_Ambulancefound > 0 ) then {
_nearHospital = true;
_Bloodmultiplier = 0.75;
};
};
_bloodAmount = _bloodAmount * _Bloodmultiplier; // Calculate bloodamount & Infectionchance with the multiplier
_infectionChance = _infectionChance / _Infectionmultiplier;
if(!_nearHospital) exitWith { // Abort messegas if Conditions not met
if ((_Hospital_enable == 1) && (_Ambulance_enable == 0)) then {
cutText [format["You need to be inside a Hospital to do this !!!"], "PLAIN DOWN"];
};
if ((_Hospital_enable == 0) && (_Ambulance_enable == 1)) then {
cutText [format["You need to be near an Ambulance to do this !!!"], "PLAIN DOWN"];
};
if ((_Hospital_enable == 1) && (_Ambulance_enable == 1)) then {
cutText [format["You need to be near a Hospital or an Ambulance to do this !!!"], "PLAIN DOWN"];
};
};