fn_protectObject.sqf
This commit is contained in:
parent
93d942c4bb
commit
a85d0fad56
|
@ -2,20 +2,26 @@
|
|||
File: fn_protectObject.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
Last Update: 2019-12-08
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
Given object will get damage and simulation enabled/disabled.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
_obj - Object to (un)protect [OBJECT, defaults to objNull]
|
||||
_enable - Enable/Disable [BOOL, defaults to true]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [ "_obj", "_enable" ];
|
||||
|
||||
params [
|
||||
["_obj", objNull, [objNull]],
|
||||
["_enable", true, [false]]
|
||||
];
|
||||
|
||||
if (isNull _obj) exitWith {["Null object given"] call BIS_fnc_error; false};
|
||||
|
||||
_obj allowDamage _enable;
|
||||
_obj enableSimulation _enable;
|
||||
|
|
|
@ -22,13 +22,13 @@ if ( _truck_to_unload getVariable ["GRLIB_ammo_truck_load", 0] > 0 ) then {
|
|||
_next_box setDamage 0;
|
||||
_offset = _offset - 2.2;
|
||||
sleep 0.5;
|
||||
[_next_box, true] remoteExec ["KPLIB_fnc_protectObject"];
|
||||
[_next_box] remoteExec ["KPLIB_fnc_protectObject"];
|
||||
[_next_box, true] remoteExec ["enableRopeAttach"];
|
||||
} foreach ( attachedObjects _truck_to_unload);
|
||||
|
||||
sleep 0.5;
|
||||
|
||||
[_truck_to_unload, true] remoteExec ["KPLIB_fnc_protectObject"];
|
||||
[_truck_to_unload] remoteExec ["KPLIB_fnc_protectObject"];
|
||||
|
||||
hint localize "STR_BOX_UNLOADED";
|
||||
uiSleep 2;
|
||||
|
|
Loading…
Reference in New Issue