Hi All,
i have written a small restriction to Krixes SelfBloodBag Script that allows the use only inside (not behind, nor on top) a hospital in Chernarus.
open player_selfbloodbag.sqf and search for
and insert this within the brackets
and then insert this just after the Config Area
If you want to restrict the location to other buildings just change Land_A_Hospital to the class name of the building that you want.
i have written a small restriction to Krixes SelfBloodBag Script that allows the use only inside (not behind, nor on top) a hospital in Chernarus.
open player_selfbloodbag.sqf and search for
Code:
private ["_bloodAmount","_humanityBool","_infectionChance","_humanityNegBool","_humanityNegAmount","_humanityAmount","_infectedLifeLost","_infectedLifeBool","_lastBloodbag","_bloodbagLastUsedTime","_bloodbagTime","_bloodbagUseTime","_bloodbagUsageTime"];
Code:
"_nearHospital","_playerASL1","_playerASLx","_playerASLy","_playerASLz","_playerASLz2","_playerASL2","_decke","_Hospitalfound","_HospitalDistance"
and then insert this just after the Config Area
Code:
_HospitalDistance = 21;
_nearHospital = false;
_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
_Hospitalfound = count nearestObjects[player,["Land_A_Hospital"],_HospitalDistance];
if ((_Hospitalfound > 0) && _decke) then {
_nearHospital = true;
};
if(!_nearHospital) exitWith {
cutText [format["You need to be inside a Hospital to do this !!!"], "PLAIN DOWN"];
};
If you want to restrict the location to other buildings just change Land_A_Hospital to the class name of the building that you want.