mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-20 18:36:29 +03:00
0.1
This commit is contained in:
31
dayz_code/compile/vehicle_handleKilled.sqf
Normal file
31
dayz_code/compile/vehicle_handleKilled.sqf
Normal file
@@ -0,0 +1,31 @@
|
||||
private["_unit","_selection","_killer"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_killer = _this select 1;
|
||||
|
||||
// Prevent spazzing out vehicles from spamming server/MySQL
|
||||
_waskilled = _unit getVariable ['waskilled', 0];
|
||||
if (_waskilled) exitWith{};
|
||||
|
||||
_unit setVariable ['waskilled', 1, true];
|
||||
|
||||
_hitPoints = _unit call vehicle_getHitpoints;
|
||||
{
|
||||
_selection = getText (configFile >> "CfgVehicles" >> (typeof _unit) >> "HitPoints" >> _x >> "name");
|
||||
_unit setVariable [_selection, 1, true];
|
||||
} forEach _hitPoints;
|
||||
|
||||
dayzUpdateVehicle = [_unit, "damage", true];
|
||||
|
||||
if (isServer) then {
|
||||
if (allowConnection) then {
|
||||
dayzUpdateVehicle call server_updateObject;
|
||||
};
|
||||
} else {
|
||||
publicVariable "dayzUpdateVehicle";
|
||||
};
|
||||
|
||||
_unit removeAllEventHandlers "HandleDamage";
|
||||
_unit removeAllEventHandlers "Killed";
|
||||
_unit removeAllEventHandlers "GetIn";
|
||||
_unit removeAllEventHandlers "GetOut";
|
||||
Reference in New Issue
Block a user