So Sollte es klappen sofern die Marker auf der Map auch als Fläche gesetzt sind
Code
#include "..\..\script_macros.hpp"
/*
File: fn_handleDamage.sqf
Author: Bryan "Tonic" Boardwine
Description:
Handles damage, specifically for handling the 'tazer' pistol and nothing else.
*/
private["_unit","_damage","_source","_projectile","_part","_curWep"];
_unit = _this select 0; //spieler
_part = _this select 1;
_damage = _this select 2; //dmg
_source = _this select 3; //quelle
_projectile = _this select 4; //Projectile geschossen
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------
//Handle the tazer first (Top-Priority).
if (!isNull _source) then {
if (_source != _unit) then {
if (currentWeapon _source in ["hgun_P07_snds_F"] && _projectile in ["B_9x21_Ball"]) then {
if(side _source in [west, civilian, resistance] && playerSide != west) then {
_damage = 0;
if (alive player && !life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
private _distance = 35;
if (_projectile == "B_556x45_dual") then {_distance = 100;};
if (_unit distance _source < _distance) then {
if !(isNull objectParent player) then {
if (typeOf (vehicle player) == "B_Quadbike_01_F") then {
player action ["Eject",vehicle player];
[_unit,_source] spawn life_fnc_tazed;
};
} else {
[_unit,_source] spawn life_fnc_tazed;
};
};
};
};
//Temp fix for super tasers on cops.
if (side _source isEqualTo west && (playerSide isEqualTo west || playerSide isEqualTo independent)) then {
_damage = false;
};
};
};
};
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
_test = getDammage _unit;
if (([_unit] call life_fnc_getRedzone) && !([_source] call life_fnc_getRedzone)) then {
_damage = _test;
_source setDamage 1;
};
private _safeZone = ["Safezone_1","Safezone_2","Safezone_3","Safezone_4","Safezone_5","Safezone_6"];
{
if ( _unit inArea _x ) exitWith {
_damage = 0;
};
} forEach _safeZone;
[] spawn life_fnc_hudUpdate;
_damage;
Alles anzeigen