Jump to content
Sign in to follow this  
=242= CPT. Helios

Virtual Spectator and TFAR

Recommended Posts

My implementation of spectator requires that

1. Players respawn when their faction and personal storage has 0 or fewer tickets. 
2. When players respawn, there is no trace of their respawned character anywhere on the map except for position [0,0,150]
3. Virtual spectator units are at position [0,0,150] so they can talk to each other in direct chat without being underwater or appearing in game.


Here are the issues.

1. Units respawn and are Visible to admins and other players.

2. Units are not moved to position [0,0,150]

3. Units bodies stand there but are not 

OnPlayerKilled.sqf

private ["_Ticketsremaining"];
_Ticketsremaining = [playerSide] call Bis_Fnc_respawntickets;
hint format ["Your faction has %1 tickets remaining", _Ticketsremaining];
[player] join grpnull;
//When you die, you're ejected from you group!
if (_Ticketsremaining <= 0) then {
	cutText ["Spectator Mode Initializing, You will respawn as a SPECTATOR", "PLAIN"];
	hint "Your Next Respawn will be as a SPECTATOR";
	sleep 2;
	[player] join grpnull;
	_playerRespawnSpectator = player addEventHandler ["Respawn", {
		["Initialize", [player]] call BIS_FNC_EGSpectator;	
		_playerKilledAsSpectator = player addEventHandler ["Killed", {
			["Terminate", [player]] call BIS_FNC_EGSpectator;
	 	}];
		player enablesimulation false;
		player allowdamage false;
		hideobject player;
		[player] join grpnull;
		player setposasl [0,0,150];
		removeallweapons player;
		removeallassigneditems player;
		removeBackpack player;
		removeVest player;
		removeHeadgear player;
		removeUniform player;
		removeGoggles player;

	}];		
	[player, 1] call Bis_Fnc_respawntickets;

};

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
Sign in to follow this  

×