Bonjour, je possède le script Restrain System et j’aimerais savoir si il serais possible de fouiller les sacs une fois la personne menottée.
if (FETCH_CONFIG2(getNumber, "CfgVehicles", _containerType, "isBackpack") isEqualTo 1) exitWith {
hint localize "STR_MISC_Backpack";
true breakOut "main";
};
if (FETCH_CONFIG2(getNumber, "CfgVehicles", _containerType, "isBackpack") isEqualTo 1 && (_unit getVariable "restrained")) exitWith {
hint localize "STR_MISC_Backpack";
true breakOut "main";
};
_isPack = FETCH_CONFIG2(getNumber,"CfgVehicles",typeOf _container,"isBackpack")
_isPack isEqualTo 1 && !(_unit getVariable "restrained")) exitWith {
hint localize "STR_MISC_Backpack";
true;
};
_isPack = FETCH_CONFIG2(getNumber,"CfgVehicles",typeOf _container,"isBackpack");
if (_isPack isEqualTo 1) exitWith {
hint localize "STR_MISC_Backpack";
true;
};
Salut,Si tu souhaite qu'on puisse fouiller dans un sac, tu retire la ligne 23 à 26 dans "core/functions/fn_inventoryOpened.sqf" :
Code:if (FETCH_CONFIG2(getNumber, "CfgVehicles", _containerType, "isBackpack") isEqualTo 1) exitWith { hint localize "STR_MISC_Backpack"; true breakOut "main"; };
EDIT : Et si tu veux que ce soit seulement si il est menotté, tu le modifie comme ceci :
Code:if (FETCH_CONFIG2(getNumber, "CfgVehicles", _containerType, "isBackpack") isEqualTo 1 && (_unit getVariable "restrained")) exitWith { hint localize "STR_MISC_Backpack"; true breakOut "main"; };
if (player getVariable "restrained") exitWith {true;};
#include "..\..\script_macros.hpp"
/*
File: fn_inventoryOpened.sqf
Author: Bryan "Tonic" Boardwine
Description:
For the mean time it blocks the player from opening another persons backpack
*/
params [
["_unit", objNull, [objNull]],
["_container", objNull, [objNull]],
["_secContainer", objNull, [objNull]]
];
scopeName "main";
private _list = ["LandVehicle", "Ship", "Air"];
{
if (isNull _x) then {false breakOut "main"};
private _containerType = typeOf _x;
/*if (FETCH_CONFIG2(getNumber, "CfgVehicles", _containerType, "isBackpack") isEqualTo 1) exitWith {
hint localize "STR_MISC_Backpack";
true breakOut "main"; original */
if (FETCH_CONFIG2(getNumber, "CfgVehicles", _containerType, "isBackpack") isEqualTo 1 && !(_unit getVariable "restrained")) exitWith {
hint localize "STR_MISC_Backpack";
true breakOut "main";
};
};
if (_containerType in ["Box_IND_Grenades_F", "B_supplyCrate_F"]) exitWith {
private _house = nearestObject [player, "House"];
if (!(_house in life_vehicles) && {_house getVariable ["locked",true]}) exitWith {
hint localize "STR_House_ContainerDeny";
true breakOut "main";
};
};
if (KINDOF_ARRAY(_x, _list)) exitWith {
if (!(_x in life_vehicles) && {locked _x isEqualTo 2}) exitWith {
hint localize "STR_MISC_VehInventory";
true breakOut "main";
};
};
//Allow alive players who've been knocked out to be looted, just not the dead ones
if (_x isKindOf "CAManBase" && {!alive _x}) exitWith {
hint localize "STR_NOTF_NoLootingPerson";
true breakOut "main";
};
} count [_container, _secContainer];
_containerType = (typeOf _container);
if (player getVariable "restrained") exitWith {true;};
#include "..\..\script_macros.hpp"
/*
File: fn_inventoryOpened.sqf
Author: Bryan "Tonic" Boardwine
Description:
For the mean time it blocks the player from opening another persons backpack
*/
private ["_container","_unit","_list"];
if (count _this isEqualTo 1) exitWith {false};
_unit = _this select 0;
_container = _this select 1;
_containerType = typeOf _container; //ICI
if (FETCH_CONFIG2(getNumber, "CfgVehicles", _containerType, "isBackpack") isEqualTo 1 && !(_unit getVariable "restrained")) exitWith {
hint localize "STR_MISC_Backpack";
true breakOut "main";
};
if ((typeOf _container) in ["Box_IND_Grenades_F","B_supplyCrate_F"]) exitWith {
_house = nearestObject [player, "House"];
if (!(_house in life_vehicles) && (_house getVariable ["locked",true])) exitWith {
hint localize "STR_House_ContainerDeny";
true;
};
};
_list = ["LandVehicle","Ship","Air"];
if (KINDOF_ARRAY(_container,_list)) exitWith {
if (!(_container in life_vehicles) && {locked _container isEqualTo 2}) exitWith {
hint localize "STR_MISC_VehInventory";
true;
};
};
//Allow alive players who've been knocked out to be looted, just not the dead ones
if (_container isKindOf "Man" && !alive _container) exitWith {
hint localize "STR_NOTF_NoLootingPerson";
true;
};
if (player getVariable "restrained") exitWith {true;};
#include "..\..\script_macros.hpp"
/*
File: fn_inventoryOpened.sqf
Author: Bryan "Tonic" Boardwine
Description:
For the mean time it blocks the player from opening another persons backpack
*/
params [
["_unit", objNull, [objNull]],
["_container", objNull, [objNull]],
["_secContainer", objNull, [objNull]]
];
scopeName "main";
private _list = ["LandVehicle", "Ship", "Air"];
{
if (isNull _x) then {false breakOut "main"};
private _containerType = typeOf _x;
/*if (FETCH_CONFIG2(getNumber, "CfgVehicles", _containerType, "isBackpack") isEqualTo 1) exitWith {
hint localize "STR_MISC_Backpack";
true breakOut "main"; original }; */
if (FETCH_CONFIG2(getNumber, "CfgVehicles", _containerType, "isBackpack") isEqualTo 1 && (_unit getVariable "restrained")) exitWith {
hint localize "STR_MISC_Backpack";
true breakOut "main";
};
if (_containerType in ["Box_IND_Grenades_F", "B_supplyCrate_F"]) exitWith {
private _house = nearestObject [player, "House"];
if (!(_house in life_vehicles) && {_house getVariable ["locked",true]}) exitWith {
hint localize "STR_House_ContainerDeny";
true breakOut "main";
};
};
if (KINDOF_ARRAY(_x, _list)) exitWith {
if (!(_x in life_vehicles) && {locked _x isEqualTo 2}) exitWith {
hint localize "STR_MISC_VehInventory";
true breakOut "main";
};
};
//Allow alive players who've been knocked out to be looted, just not the dead ones
if (_x isKindOf "CAManBase" && {!alive _x}) exitWith {
hint localize "STR_NOTF_NoLootingPerson";
true breakOut "main";
};
} count [_container, _secContainer];