Пытаюсь закрыть ящик.
Думал воспользуюсь командой lock, но безуспешно.
Подскажите как выполнить закрытие ящика ?
Лучший Ответ Schatten , 11 October 2018 - 11:44
this addEventHandler ["ContainerOpened", { [] spawn { _display = displayNull; _time = time + 1; waitUntil { sleep 0.1; _display = findDisplay 602; !(isNull _display) or {time >= _time} }; if (!(isNull _display)) then { _display closeDisplay 0; }; }; }];
P. S.
В следующий раз сообщение об ошибке полностью публикуй.
Отправлено 10 October 2018 - 12:43
Пытаюсь закрыть ящик.
Думал воспользуюсь командой lock, но безуспешно.
Подскажите как выполнить закрытие ящика ?
Отправлено 10 October 2018 - 20:28
Установить на ящик переменную, и добавить евентхендрел OpenInventory с проверкой этой самой переменной и throw для закрытия
либо вместо переменной использовать lock, и проверять его в OpenInventory
Отправлено 11 October 2018 - 00:07
Отправлено 11 October 2018 - 07:56
Ну вроде работает.
container addEventHandler ["ContainerOpened", { [] spawn { while {true} do { _gear = findDisplay 602; if (!isNull findDisplay 602) then { remoteExec 602; }; sleep 0.1; }; }; }];
Сообщение отредактировал moroz89: 11 October 2018 - 07:56
Отправлено 11 October 2018 - 11:19
Ну вроде работает.
container addEventHandler ["ContainerOpened", { [] spawn { while {true} do { _gear = findDisplay 602; if (!isNull findDisplay 602) then { remoteExec 602; }; sleep 0.1; }; }; }];закинул в инит ящика this addEventHandlerвыдало ошибку
Отправлено 11 October 2018 - 11:44 Лучший Ответ
this addEventHandler ["ContainerOpened", { [] spawn { _display = displayNull; _time = time + 1; waitUntil { sleep 0.1; _display = findDisplay 602; !(isNull _display) or {time >= _time} }; if (!(isNull _display)) then { _display closeDisplay 0; }; }; }];
P. S.
В следующий раз сообщение об ошибке полностью публикуй.
Сообщение отредактировал Schatten: 11 October 2018 - 12:43
Отправлено 11 October 2018 - 11:55
Отправлено 11 October 2018 - 22:18
P. S.
В следующий раз сообщение об ошибке полностью публикуй.
Отправлено 11 October 2018 - 23:40
private _fake_container = createSimpleObject [configFile >> "CfgVehicles" >> typeOf _container, [0, 0, 0]]; _fake_container setPosWorld getPosWorld _container; _fake_container setVectorDirAndUp [vectorDir _container, vectorUp _container]; _container allowDamage false; _container hideObjectGlobal true; _container enableSimulationGlobal false; _container setVariable ["fake_container", _fake_container];PS Для некоторых контейнеров иногда срабатывает способ с отключением симуляции и установкой урона в 1
Сообщение отредактировал vlad333000: 11 October 2018 - 23:46
Отправлено 07 May 2019 - 22:04
А если кому то можно а кому то низзя? Что лучше - раздать всем клиентам кроме него пустышки или вот так:
player addEventHandler["InventoryOpened",{
params ["_unit", "_container"];
_list = _unit nearSupplies 3.6;
_zapret = false;
{
_owner = _x getVariable ["ownercargo",nil];
if !(isNil "_owner") then {
if !(_owner isEqualTo (getPlayerUID player)) exitWith {
_zapret = true;
};
};
} forEach (_unit nearSupplies 3.6);
if (_zapret) then {
hint "Чужой ящик";
true;
};
}];
Отправлено 07 May 2019 - 22:26
вариант из шапки всегда легко багоюзился