{"name":"BIS_fnc_respawnManager","title":"BIS fnc respawnManager","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_respawnManager","revid":379569,"updated":"2026-10-31T13:57:22Z","groups":["Respawn"],"status":"ok","games":{"arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2oa 1.50","arma3_since":"0.50","description":"Respawn manager with checkpoints. Checkpoints are markers named \"BIS_checkpointnr1\", \"BIS_checkpointnr2\", ... (numbered without gaps); at least one must exist when the manager is initialised.\n\"Init\" creates the global logic *BIS_RespawnManager* that holds the manager's data and adds \"Killed\" and \"Respawn\" event handlers to the given units:\n\n- when a unit dies, the checkpoint nearest to it is stored for it;\n- when it respawns, the new unit gets the old unit's weapons and magazines. If a vehicle named *<unitName>_Vehicle* exists, it is respawned, moved to a safe position near the stored checkpoint (see BIS_fnc_findSafePos) and its crew is restored.\n\nEvery mode except \"Init\" returns false while the manager is not initialised. The function is meant to be called by mission scripts; no Arma 3 script calls it.\n\n> [!IMPORTANT]\n> - This is legacy Arma 2 code: the event handlers are added through the Arma 2 Multiplayer Framework function *RE*, which is not part of Arma 3's Functions Library.\n> - Parameters are passed on by format and compile: units must therefore have a variable name.","syntaxes":[{"syntax":"[\"Init\", [respawners, safePositions], markerVisibility] call BIS_fnc_respawnManager","params":[{"name":"\"Init\"","type":"String","description":"initialises the manager","type_expr":"String"},{"name":"respawners","type":"Array of Objects","description":"respawning units","type_expr":"Array<Object>"},{"name":"safePositions","type":"Array of Positions","description":"one position per unit, used when no safe position is found for its vehicle; when empty, [8179.12, 1881.57, 0] is used for every unit","type_expr":"Array<Position>"},{"name":"markerVisibility","type":"String","optional":true,"default":"\"\"","description":"\"\", \"true\" or \"false\"; every value currently results in checkpoint marker type \"EMPTY\"","type_expr":"String","text":"markerVisibility: String - (Optional, default \"\") \"\", \"true\" or \"false\"; every value currently results in checkpoint marker type \"EMPTY\""}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"false if the manager was already initialised, otherwise true"}},{"syntax":"[\"Destroy\"] call BIS_fnc_respawnManager","params":[{"name":"\"Destroy\"","type":"String","description":"deletes the manager logic","type_expr":"String"}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"true"}},{"syntax":"[\"AddCheckpoint\", position, markerName] call BIS_fnc_respawnManager","params":[{"name":"\"AddCheckpoint\"","type":"String","description":"creates a checkpoint marker and adds it to the list","type_expr":"String"},{"name":"position","type":"Array format Position","description":"checkpoint position","type_expr":"Position","types":["Array","Position"]},{"name":"markerName","type":"String","optional":true,"default":"\"\"","description":"marker name; if empty, the next free \"BIS_checkpointnr*N*\" name is used","type_expr":"String","text":"markerName: String - (Optional, default \"\") marker name; if empty, the next free \"BIS_checkpointnr*N*\" name is used"}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"true"}},{"syntax":"[\"RemoveCheckpoint\", markerName] call BIS_fnc_respawnManager","params":[{"name":"\"RemoveCheckpoint\"","type":"String","description":"removes a checkpoint from the list and deletes its marker","type_expr":"String"},{"name":"markerName","type":"String","description":"checkpoint marker name","type_expr":"String"}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"true if removed, false if the marker is not a checkpoint or it is the last one"}},{"syntax":"[\"GetNearestCheckpoint\", unit] call BIS_fnc_respawnManager","params":[{"name":"\"GetNearestCheckpoint\"","type":"String","description":"returns the checkpoint stored for a unit","type_expr":"String"},{"name":"unit","type":"Object","description":"one of the respawning units","type_expr":"Object"}],"returns":{"type":"String","type_expr":"String","description":"marker name of the checkpoint stored for the unit, or the first checkpoint if none is stored"}}],"examples":[{"code":["// markers \"BIS_checkpointnr1\", \"BIS_checkpointnr2\" are placed in the mission\n[\"Init\", [[BIS_player1, BIS_player2], []]] call BIS_fnc_respawnManager;\n[\"AddCheckpoint\", getMarkerPos \"BIS_village\", \"BIS_checkpointVillage\"] call BIS_fnc_respawnManager;\n[\"RemoveCheckpoint\", \"BIS_checkpointnr1\"] call BIS_fnc_respawnManager;"]}],"see_also":["Arma 3: Respawn","BIS_fnc_addRespawnPosition","BIS_fnc_findSafePos"]}