Jump to content

Disable respawn for particular side

Recommended Posts

Hello all,


I'm doing a survival mission where OPFOR are 'on the run' and are being chased by BLUFOR players.


The setup I want is that BLUFOR have respawn and respawn at their base. I currently have this setup as a BASE respawn with a respawn_west marker. This works fine. However, OPFOR once dead I don't want to respawn. There are only at most two players on OPFOR.


So, desired outcome for OPFOR is;

- If another OPFOR player is alive, launch spectator mode and spectate that player. Disable chat/von for those who have died.

- If all OPFOR are dead, then mission end is triggered as both have been killed (of course, if there was only one player this would trigger on the players death too)


Currently, I have a piece of code in onPlayerRespawn.sqf. The west one just relaunches the marker script I have and no issues here. It's the east case that's my issue.


switch (playerSide) do {
    case west: {
        [_this select 0] execVM "police.sqf";
    case east: {
		if((!alive s1) && (!alive s2)) then { killersDead = true; publicVariable "killersDead"; } else {
			1 enableChannel [false, false];
			2 enableChannel [false, false];
			4 enableChannel [false, false];
			5 enableChannel [false, false];
			["Initialize", [player, [east], true]] call BIS_fnc_EGSpectator;

Now the issue I have is because the two OPFOR players (s1 and s2) respawn, ultimately the check if both have been killed won't work so I've been trying to think this but I wonder if there is a better way to manage the respawn? Additionally, the spectate script lets you spectate your respawned player and see them on the map. So perhaps I'm going the wrong way about it.

All players will be human controlled. None are played by AI.


If anyone can suggest a different way to manage the respawns in this situation that would be great. Not necessarily asking for someone to write the code but I suspect that since I done any proper development in ARMA (as in the first one) things like respawns have improved. I've had a look at the biki but nothing stands out as being better?




Share this post

Link to post
Share on other sites

To further add, I found out about respawnTemplates to be able to do separate things for each side.


It sort of lead me in the right direction... however the OPFOR unit still respawns and ends the spectate. So not good :(

Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now