Updated parameterization in Captives module.

This commit is contained in:
jokoho48 2015-08-05 01:15:20 +02:00
parent 275b0c4300
commit 24dd320c3c
28 changed files with 36 additions and 39 deletions

View File

@ -16,8 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_target); params ["_unit", "_target"];
//Check sides, Player has cableTie, target is alive and not already handcuffed //Check sides, Player has cableTie, target is alive and not already handcuffed
(GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) && (GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) &&

View File

@ -16,8 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_target); params ["_unit", "_target"];
//Alive, handcuffed, not being escored, and not unconscious //Alive, handcuffed, not being escored, and not unconscious
(_target getVariable [QGVAR(isHandcuffed), false]) && (_target getVariable [QGVAR(isHandcuffed), false]) &&

View File

@ -16,7 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_target); params ["_unit", "_target"];
_target getVariable [QGVAR(isHandcuffed), false] _target getVariable [QGVAR(isHandcuffed), false]
|| {_target getVariable [QGVAR(isSurrendering), false]} || {_target getVariable [QGVAR(isSurrendering), false]}

View File

@ -18,8 +18,7 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_objects"]; private ["_objects"];
params ["_unit", "_target","_vehicle"];
PARAMS_3(_unit,_target,_vehicle);
if (isNull _target) then { if (isNull _target) then {
_objects = attachedObjects _unit; _objects = attachedObjects _unit;

View File

@ -16,7 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_target); params ["_unit", "_target"];
//Unit is handcuffed and not currently being escorted //Unit is handcuffed and not currently being escorted
_target getVariable [QGVAR(isHandcuffed), false] && _target getVariable [QGVAR(isHandcuffed), false] &&

View File

@ -16,8 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_1(_unit); params ["_unit", ["_target", objNull]];
DEFAULT_PARAM(1,_target,objNull);
if (isNull _target) then { if (isNull _target) then {
_target = _unit getVariable [QGVAR(escortedUnit), objNull]; _target = _unit getVariable [QGVAR(escortedUnit), objNull];

View File

@ -16,12 +16,12 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_newSurrenderState);
private "_returnValue"; private "_returnValue";
params ["_unit", "_newSurrenderState"];
_returnValue = if (_newSurrenderState) then { _returnValue = if (_newSurrenderState) then {
//no weapon equiped AND not currently surrendering and //no weapon equiped AND not currently surrendering and
GVAR(allowSurrender) && {(currentWeapon _unit) == ""} && {!(_unit getVariable [QGVAR(isSurrendering), false])} GVAR(allowSurrender) && {(currentWeapon _unit) == ""} && {!(_unit getVariable [QGVAR(isSurrendering), false])}
} else { } else {
//is Surrendering //is Surrendering

View File

@ -18,6 +18,6 @@
private ["_cargo"]; private ["_cargo"];
PARAMS_2(_player,_unit); params ["_player", "_unit"];
((vehicle _unit) != _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]} ((vehicle _unit) != _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}

View File

@ -16,10 +16,11 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_target);
_unit removeItem "ACE_CableTie"; params ["_unit", "_target"];
playSound3D [QUOTE(PATHTO_R(sounds\cable_tie_zipping.ogg)), objNull, false, (getPosASL _target), 1, 1, 10]; playSound3D [QUOTE(PATHTO_R(sounds\cable_tie_zipping.ogg)), objNull, false, (getPosASL _target), 1, 1, 10];
["SetHandcuffed", [_target], [_target, true]] call EFUNC(common,targetEvent); ["SetHandcuffed", [_target], [_target, true]] call EFUNC(common,targetEvent);
_unit removeItem "ACE_CableTie";

View File

@ -17,7 +17,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_3(_unit,_target,_state); params ["_unit", "_target","_state"];
if (_state) then { if (_state) then {
if (_unit getVariable [QGVAR(isEscorting), false]) exitWith {}; if (_unit getVariable [QGVAR(isEscorting), false]) exitWith {};

View File

@ -19,6 +19,7 @@
private ["_weapon", "_listedItemClasses", "_actions", "_allGear"]; private ["_weapon", "_listedItemClasses", "_actions", "_allGear"];
PARAMS_2(_player,_unit); PARAMS_2(_player,_unit);
params ["_player", "_unit"];
_weapon = currentWeapon _player; _weapon = currentWeapon _player;
if (_weapon == primaryWeapon _player && {_weapon != ""}) then { if (_weapon == primaryWeapon _player && {_weapon != ""}) then {

View File

@ -17,9 +17,10 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_3(_unit,_target,_vehicle);
private "_objects"; private "_objects";
params ["_unit", "_target","_vehicle"];
if (isNull _target) then { if (isNull _target) then {
_objects = attachedObjects _unit; _objects = attachedObjects _unit;
_objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); _objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter);

View File

@ -15,6 +15,6 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_target); params ["_unit", "_target"];
["SetHandcuffed", [_target], [_target, false]] call EFUNC(common,targetEvent); ["SetHandcuffed", [_target], [_target, false]] call EFUNC(common,targetEvent);

View File

@ -16,6 +16,6 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_target); params ["_unit", "_target"];
["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent); ["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent);

View File

@ -17,7 +17,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_3(_vehicle,_dontcare,_unit); params ["_vehicle", "_dontcare","_unit"];
if (local _unit) then { if (local _unit) then {
if (_unit getVariable [QGVAR(isEscorting), false]) then { if (_unit getVariable [QGVAR(isEscorting), false]) then {

View File

@ -17,7 +17,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_3(_vehicle,_dontcare,_unit); params ["_vehicle", "_dontcare","_unit"];
if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then { if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then {
private ["_cargoIndex"]; private ["_cargoIndex"];

View File

@ -15,7 +15,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_1(_oldUnit); params ["_oldUnit"];
if (!local _oldUnit) exitWith {}; if (!local _oldUnit) exitWith {};

View File

@ -16,7 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_2_PVT(_this,_unit,_isUnconc); params ["_unit","_isUnconc"];
if (!local _unit) exitWith {}; if (!local _unit) exitWith {};

View File

@ -16,7 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_newUnit,_oldUnit); params ["_newUnit","_oldUnit"];
//set showHUD based on new unit status: //set showHUD based on new unit status:
if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then { if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then {

View File

@ -16,7 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_dead); params ["_unit","_dead"];
if (!local _unit) exitWith {}; if (!local _unit) exitWith {};

View File

@ -15,7 +15,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_1(_unit); params ["_unit"];
// prevent players from throwing grenades (added to all units) // prevent players from throwing grenades (added to all units)
[_unit, "Throw", {((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}}, {}] call EFUNC(common,addActionEventhandler); [_unit, "Throw", {((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}}, {}] call EFUNC(common,addActionEventhandler);

View File

@ -17,7 +17,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_zeusIsOpen); params ["_unit","_zeusIsOpen"];
//set showHUD based on unit status: //set showHUD based on unit status:
if (!_zeusIsOpen) then { if (!_zeusIsOpen) then {

View File

@ -13,7 +13,7 @@
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_1(_logic); parmas ["_logic"];
[_logic, QGVAR(allowHandcuffOwnSide), "allowHandcuffOwnSide"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowHandcuffOwnSide), "allowHandcuffOwnSide"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(allowSurrender), "allowSurrender"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowSurrender), "allowSurrender"] call EFUNC(common,readSettingFromModule);

View File

@ -17,9 +17,10 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_3(_logic,_units,_activated);
private ["_bisMouseOver", "_mouseOverObject"]; private ["_bisMouseOver", "_mouseOverObject"];
params ["_logic", "_units", "_activated"];
if (!_activated) exitWith {}; if (!_activated) exitWith {};
if (local _logic) then { if (local _logic) then {

View File

@ -16,8 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_state); params ["_unit","_state"];
if (!local _unit) exitwith { if (!local _unit) exitwith {
ERROR("running setHandcuffed on remote unit"); ERROR("running setHandcuffed on remote unit");
@ -43,7 +42,7 @@ if (_state) then {
// fix anim on mission start (should work on dedicated servers) // fix anim on mission start (should work on dedicated servers)
[{ [{
PARAMS_1(_unit); params ["_unit"];
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
[_unit] call EFUNC(common,fixLoweredRifleAnimation); [_unit] call EFUNC(common,fixLoweredRifleAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);

View File

@ -16,8 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_unit,_state); params ["_unit","_state"];
if (!local _unit) exitwith { if (!local _unit) exitwith {
ERROR("running surrender on remote unit"); ERROR("running surrender on remote unit");

View File

@ -16,10 +16,10 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_target,_vehicle);
private ["_cargoIndex"]; private ["_cargoIndex"];
params ["_target","_vehicle"];
_target moveInCargo _vehicle; _target moveInCargo _vehicle;
_target assignAsCargo _vehicle; _target assignAsCargo _vehicle;
_cargoIndex = _vehicle getCargoIndex _target; _cargoIndex = _vehicle getCargoIndex _target;

View File

@ -15,8 +15,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_1(_unit); params ["_unit"];
_unit setVariable [QGVAR(CargoIndex), -1, true]; _unit setVariable [QGVAR(CargoIndex), -1, true];
moveOut _unit; moveOut _unit;