Jump to content

Recommended Posts

so i want to end the game if the opposite side s tickets reach an amount but dosent seems to work

_side = side player;

[_side, -97] call BIS_fnc_respawnTickets;
[] spawn {waitUntil {sleep 2;
if [_side] call BIS_fnc_respawnTickets == 0} > [east] call BIS_fnc_respawnTickets then
"end1" call BIS_fnc_endMission;
};
 

Share this post


Link to post
Share on other sites

Something like...

Spoiler

//initServer.sqf

//Add starting tickets for both sides
[ west, 100 ] call BIS_fnc_respawnTickets;
[ east, 100 ] call BIS_fnc_respawnTickets;

//Subscribe to scripted event for when tickets are exhausted
[ missionNamespace, "respawnTicketsExhausted", {
	params[ "_loosingSide" ];
	
	_winningSide = [ east, west ] - [ _loosingSide ] select 0;
	
	[ "SideWon", true, true ] remoteExec[ "BIS_fnc_endMission", _winningSide ];
	[ "SideLost", false, 4 ] remoteExec[ "BIS_fnc_endMission", _loosingSide ];
	
	if ( isDedicated ) then {
		[] spawn {
			sleep 5;
			[ "end1" ] call BIS_fnc_endMissionServer;
		};
	};
	
}] call BIS_fnc_addScriptedEventHandler;

 

  • Like 1

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

×