mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 21:29:59 +03:00
Traps and Utill Folders/Files
This commit is contained in:
12
SQF/dayz_code/traps/functions/arm.sqf
Normal file
12
SQF/dayz_code/traps/functions/arm.sqf
Normal file
@@ -0,0 +1,12 @@
|
||||
_trap = _this select 0;
|
||||
_trigger = _this select 1;
|
||||
|
||||
_trap animate ['LeftShutter', 0];
|
||||
_trap animate ['RightShutter', 0];
|
||||
|
||||
_trap setVariable ["armed", true, true];
|
||||
PVDZ_veh_Save = [_trap, "gear"];
|
||||
publicVariableServer "PVDZ_veh_Save";
|
||||
|
||||
dayz_traps_active set [count dayz_traps_active, _trap];
|
||||
dayz_traps_trigger set [count dayz_traps_trigger, _trigger];
|
||||
14
SQF/dayz_code/traps/functions/disarm.sqf
Normal file
14
SQF/dayz_code/traps/functions/disarm.sqf
Normal file
@@ -0,0 +1,14 @@
|
||||
_trap = _this select 0;
|
||||
|
||||
_trap animate ['LeftShutter', 1];
|
||||
_trap animate ['RightShutter', 1];
|
||||
|
||||
_trap setVariable ["armed", false, true];
|
||||
PVDZ_veh_Save = [_trap, "gear"];
|
||||
publicVariableServer "PVDZ_veh_Save";
|
||||
|
||||
if (_trap in dayz_traps_active) then {
|
||||
deleteVehicle (dayz_traps_trigger select (dayz_traps_active find _trap));
|
||||
dayz_traps_trigger = dayz_traps_trigger - [dayz_traps_trigger select (dayz_traps_active find _trap)];
|
||||
dayz_traps_active = dayz_traps_active - [_trap];
|
||||
};
|
||||
1
SQF/dayz_code/traps/functions/remove.sqf
Normal file
1
SQF/dayz_code/traps/functions/remove.sqf
Normal file
@@ -0,0 +1 @@
|
||||
[nil,nil,nil,_this select 0] call compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf"
|
||||
18
SQF/dayz_code/traps/functions/setup.sqf
Normal file
18
SQF/dayz_code/traps/functions/setup.sqf
Normal file
@@ -0,0 +1,18 @@
|
||||
private ["_id", "_uid", "_armed"];
|
||||
_trap = _this select 0;
|
||||
|
||||
if (!isNull _trap) then {
|
||||
while { true } do {
|
||||
_id = _trap getVariable ["ObjectID", "0"];
|
||||
_uid = _trap getVariable ["ObjectUID", "0"];
|
||||
_armed = _trap getVariable "armed";
|
||||
|
||||
if (isNull _trap) exitWith { /* break from loop */ };
|
||||
|
||||
if (((parseNumber _id > 0) || (parseNumber _uid > 0)) && !isNil "_armed") exitWith {
|
||||
dayz_traps set [count dayz_traps, _trap];
|
||||
};
|
||||
|
||||
sleep 0.5;
|
||||
};
|
||||
};
|
||||
7
SQF/dayz_code/traps/functions/trigger.sqf
Normal file
7
SQF/dayz_code/traps/functions/trigger.sqf
Normal file
@@ -0,0 +1,7 @@
|
||||
_trap = _this select 0;
|
||||
|
||||
if (getNumber (configFile >> "CfgVehicles" >> typeOf _trap >> "singleUse") > 0) then {
|
||||
[_trap] call remove_trap;
|
||||
} else {
|
||||
[_trap] call disarm_trap;
|
||||
};
|
||||
Reference in New Issue
Block a user