Jump to content
Sign in to follow this  
Redphoenix

Check Respawn Tickets then end mission

Recommended Posts

So, i set up a team deathmatch mission, but I cannot bring the mission to end when there are no respawn tickets left.

This is my init.sqf

// Random VR Object Placer
if (isServer) then
{
0 = ["marker", 28, 6] execVM "scripts\Zen_GenerateVRArea.sqf";
[west,4] call BIS_fnc_respawnTickets;
[resistance,4] call BIS_fnc_respawnTickets;
};


// Teleporter
teleportFunction =
{
private["_trigger","_unit","_position","_pos","_dir"];
//_spawnpunkte = [synchronizedObjects _trigger];

_trigger = _this select 0;
_position =  synchronizedObjects _trigger;
//_position = _spawnpunkte call BIS_fnc_selectRandom;
_unit =  list _trigger;
_dir = getDir (_position select 0);
_unit = _unit select 0;
_pos = getPosATL (_position select 0);
_unit setPosATL _pos;
_unit setDir _dir
};



if ((!isServer) && (player != player)) then {waitUntil {player == player}; };

enableSaving [false, false];


// Mission Ending
missionEnding =
while {true} do
{
{
	private["_wtickets","_rtickets"];
	_wtickets = [west] call BIS_fnc_respawnTickets;
	_rtickets = [resistance] call BIS_fnc_respawnTickets;
	if ((_wtickets <= 0) || (_rtickets <=0)) then {"END1" call BIS_fnc_endMission};
foreach allunits;
Sleep 0.2;
};

Any ideas?

Tested nearly everything the whole day... replaced the fnc with simple endMission, but didn't work...

Edited by RedPhoenix

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  

×