Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
"RHAI_changeRating" addPublicVariableEventHandler {
_targets = (_this select 1) select 0;
_rating = (_this select 1) select 1;
{
if (local _x) then {
if(rating _x > _rating) then {
_x addRating _rating;
};
};
} forEach _targets;
};
_unitsAlive = {alive _x} count (units _this);
while {_unitsAlive > 0} do {
_nearEntities = (leader _UnitGroup) nearEntities ["zZombie_Base",150];
{
if (local _x) then {
if(rating _x > -30000) then {
_x addrating -30000;
};
} else {
RHAI_changeRating = [[_x],(-30000)];
(owner _x) publicVariableClient "RHAI_changeRating";
};
} foreach _nearEntities;
sleep 15;
_unitsAlive = {alive _x} count (units _UnitGroup);
};
fnc_eh_fired = {
private ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_magcnt"];
_unit = _this select 0; //unit: Object - Object the event handler is assigned to
_weapon = _this select 1; //weapon: String - Fired weapon
//_muzzle = _this select 2; //muzzle: String - Muzzle that was used
//_mode = _this select 3; //mode: String - Current mode of the fired weapon
_ammo = _this select 4; //ammo: String - Ammo used
_magazine = _this select 5; //magazine: String - magazine name which was used
//_projectile = _this select 6; //projectile: object - Object of the projectile that was shot
// *** Munition nachfüllen ***
_magcnt = {_x == _magazine} count (magazines _unit);
if ( (_unit ammo _weapon == 0) OR _magcnt <= 2) then {
//_unit removeMagazines _magazine;
_unit addMagazine _magazine;
};
};
_unit addEventHandler ["Fired", {_this call fnc_eh_fired;}];