CVARSSometimes, if there are several players standing in front of a safe room door, or if weapons/medkits are scattered around, pressing "E" might not work or might interact with items instead, even if you are right in front of it, which can be incredibly frustrating. This plugin fixes the issue, making doors work as intended. It should theoretically be compatible with most door-related plugins. There is a native for unscramblers or lockers if you need to allow operation only after a certain event.
Nativesl4d2_fix_safedoor_use_distance_to_open [100] - You will be able to OPEN doors from this distance
l4d2_fix_safedoor_use_distance_to_close [115] - You will be able to CLOSE doors from this distance
l4d2_fix_safedoor_use_wait_permission_from_ot her_plugin [0] - In case you use unscrambler or door locker, wait for it (to use native)
Short videonative void FixSafedoorUseEnable();
Tech
The plugin places and saves three points on each door: left, center, and right. It monitors their coordinates when the door's position changes. If the player presses "E" near these points, it uses trace ray to ensure the player is looking at the door. In case of player_use triggered by the engine, some decisions are taken in the next frame to avoid conflicts with other plugins. Then, AcceptInput is used for opening/closing and sends a player_use event for other plugins. If the door has DOOR_FLAG_IGNORE_USE enabled, it also won't work.
Attached Files


Wyświetl pełny artykuł