diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:55:41 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:55:41 +0300 |
| commit | dee52083d359434fc3ac51a871c1b836d092d2ac (patch) | |
| tree | 89bbb6326348a99bcf4a68761bd0c9628b80d4bb /Server/Functions/Server_BuildingDamaged.sqf | |
| download | a2wf_lingor-dee52083d359434fc3ac51a871c1b836d092d2ac.tar.gz a2wf_lingor-dee52083d359434fc3ac51a871c1b836d092d2ac.tar.bz2 a2wf_lingor-dee52083d359434fc3ac51a871c1b836d092d2ac.zip | |
init
Diffstat (limited to '')
| -rw-r--r-- | Server/Functions/Server_BuildingDamaged.sqf | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Server/Functions/Server_BuildingDamaged.sqf b/Server/Functions/Server_BuildingDamaged.sqf new file mode 100644 index 0000000..034a8ef --- /dev/null +++ b/Server/Functions/Server_BuildingDamaged.sqf @@ -0,0 +1,18 @@ +Private["_currentDammages","_damage","_damagedBy","_side","_structure","_timeAttacked"];
+
+_structure = _this Select 0;
+_damagedBy = _this Select 1;
+_damage = _this Select 2;
+_currentDammages = getDammage _structure;
+
+_side = east;
+if ((typeOf _structure) in ('WFBE_WESTSTRUCTURENAMES' Call GetNamespace)) then {_side = west};
+
+_timeAttacked = Format["WFBE_%1_TimeUnderAttack",str _side] Call GetNamespace;
+
+if (_side != Side _damagedBy) then {
+ if (time - _timeAttacked > 30 && _damage > 0.05 && ((_currentDammages + _damage) < 1)) then {
+ [Format["WFBE_%1_TimeUnderAttack",str _side],time,true] Call SetNamespace;
+ ["IsUnderAttack",TypeOf _structure ,_side] Spawn SideMessage;
+ };
+};
\ No newline at end of file |
