Jump to content
Casio91Fin

The sector resets the counter. (problem)

Recommended Posts

The problem is that when the ownership of the sector changes. It also resets my counter and starts over. 

(the counter resets when the players clears the sector of enemies. And the players is inside the sector itself too.) 
How would I get the counter to remember?

 

Otherwise, it won't happen even if the enemy takes over the sector and the players later take it back.

initServer.sqf

Spoiler

{
	[ _x, "ownerChanged", {
		params[ "_sector", "_owner", "_ownerOld" ];

	if ( _owner isEqualTo EAST ) then 
		{
			
		};

	if ( _owner isEqualTo west ) then 
		{
            
		};

    	if ( _owner isEqualTo independent ) then 
		{
			
		};

        if (_owner isEqualTo sideUnknown) then 
        {
			
        };

		SP_fnc_getUnit = compile preprocessFileLineNumbers "MissionFile\UnitClass.sqf";
		_SwitchTeam = "SwitchTeam" call BIS_fnc_getParamValue;
		publicVariable "SwitchTeam";
		null = [_SwitchTeam,_sector] execVM "MissionFile\MissionInit.sqf";

	}] call BIS_fnc_addScriptedEventHandler; 
} forEach ( true call BIS_fnc_moduleSector );

 

 

.......\Mission.sqf";
 

Spoiler

_TotalSpawned = 0;
while {_TotalSpawned < _MaxAiTeams} do 
{ 
    while {count units west <= _MaxActiveAI - 1 && _TotalSpawned < _MaxAiTeams} do  
    {       
        //Infantry 1.
        if (_MaxActiveAI - count units west >= 20) then 
        {
			inf
  			_TotalSpawned = _TotalSpawned + 1;
		};
		//APC.
        if (_MaxActiveAI - count units west >= 20) then 
        {
			APC
  			_TotalSpawned = _TotalSpawned + 1;
		};
  		//Mission WON
        if (_TotalSpawned >= _MaxAiTeams) then
        {  
            Mission end skripts          
        };
	};
  sleep x;
};

 

 

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

×