Back to the topic! :)
I found a nice way to "dynamically" disable/enable player respawns by SYNCing a trigger to BIS Respawn position (Modules -> Multiplayer -> Respawn position).
Using the code snippet
((count ([getposATL thisTrigger, 300, ["GUER","entity"]] call ALIVE_fnc_getNearProfiles)) == 0);
I first saw here Best way to "end mission" in large scale assault?, has proved to be very useful in many scenarios :)
Here's but one way to create multiplayer respawns that get disabled/enabled according to the enemy presence near a respawn:
create a trigger that is Repeatable and in the Condition field add the code snippet
((count ([getposATL thisTrigger, 300, ["GUER","entity"]] call ALIVE_fnc_getNearProfiles)) == 0);
- 300 is the radius or area where, if enemy is present, the respawn should be disabled
- change GUER to represent the enemy faction (eg. EAST, GUER, NATO) or anything that is supposed to represent an entity that should enable/disable the player respawn
- use == 0 for call ALIVE_fnc_getNearProfiles (in short: when eg. GUER profiles is 0 inside the trigger area respawn will be available, when GUER profiles is more than 0 respawn will be disabled)
Then place one BIS Respawn position as close as possible the trigger you just created and sync it to the trigger and you're done!
This method has so far worked flawlessly for disabling player respawns when there's enemy profiles (virtualized or spawned) inside the trigger area. Naturally when there's no more enemy profiles inside the trigger area the player respawn will once again become available.