Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "..\..\script_macros.hpp"
- /*
- File: fn_doorAnimate.sqf
- Author: Bryan "Tonic" Boardwine
- Description:
- Animates a door?
- */
- private ["_b","_doors","_door"];
- _b = _this select 0;
- _doors = 1;
- _doors = FETCH_CONFIG2(getNumber,"CfgVehicles",typeOf _b,"NumberOfDoors");
- _door = 0;
- for "_i" from 1 to _doors do {
- private _selPos = _b selectionPosition format ["Door_%1_trigger",_i];
- private _worldSpace = _b modelToWorld _selPos;
- if (player distance _worldSpace < 5) exitWith {_door = _i;};
- };
- if (_door isEqualTo 0) exitWith {hint localize "STR_Cop_NotaDoor"};
- if ((typeof _b) == "Land_Dome_Big_F") then {
- switch (_door) do {
- case 1 : {
- if (_b animationPhase "door_1a_move" isEqualto 0) then {
- _b animate ["door_1a_move",1];
- _b animate ["door_1b_move",1];
- } else {
- _b animate ["door_1a_move",0];
- _b animate ["door_1b_move",0];
- };
- };
- default {
- _doorAnimation = format ["door_%1_rot",_door];
- if ((_b animationPhase _doorAnimation) isEqualto 0) then {
- _b animate [_doorAnimation,1];
- } else {
- _b animate [_doorAnimation,0];
- };
- };
- };
- } else {
- _doorAnimation = format ["door_%1_rot",_door];
- if ((_b animationPhase _doorAnimation) isEqualto 0) then {
- _b animate [_doorAnimation,1];
- } else {
- _b animate [_doorAnimation,0];
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement