//////////////////////////////////////////////////////////////////
// File: init.sqf
// By: TF5-SGM.Spyder
// Version: 0-0-8
//////////////////////////////////////////////////////////////////
[] execVM "scripts\objective_sys\init_objectives.sqf";
[] execVM "scripts\ticket_sys\ticket_count.sqf";
[] execVM "scripts\ticket_sys\player_death.sqf";
//////////////////////////////////////////////////////////////////
// File: objective_status.sqf
// By: TF5-SGM.Spyder
//////////////////////////////////////////////////////////////////
Sleep 1;
// ==================== BLUFOR Constant ====================
BLUFOR_Constant = createTrigger ["EmptyDetector", getMarkerPos "Objective_1"];
BLUFOR_Constant setTriggerArea [300, 200, 0, true];
BLUFOR_Constant setTriggerActivation ["WEST", "PRESENT", true];
BLUFOR_Constant setTriggerTimeout [0, 0, 0, true];
BLUFOR_Constant setTriggerStatements ["this", "BLUFOR_ConstantB = true", "BLUFOR_ConstantB = false"];
// ==================== End BLUFOR Start ====================
// ==================== REDFOR Constant ====================
REDFOR_Constant = createTrigger ["EmptyDetector", getMarkerPos "Objective_1"];
REDFOR_Constant setTriggerArea [300, 200, 0, true];
REDFOR_Constant setTriggerActivation ["EAST", "PRESENT", true];
REDFOR_Constant setTriggerTimeout [0, 0, 0, true];
REDFOR_Constant setTriggerStatements ["this", "REDFOR_ConstantB = true", "REDFOR_ConstantB = false"];
// ==================== End REDFOR Start ====================
// ==================== BLUFOR addTicket ====================
BLUFOR_addTicket = createTrigger ["EmptyDetector", getMarkerPos "Objective_1"];
BLUFOR_addTicket setTriggerArea [300, 200, 0, true];
BLUFOR_addTicket setTriggerActivation ["WEST", "PRESENT", true];
BLUFOR_addTicket setTriggerTimeout [1, 1, 1, true];
BLUFOR_addTicket setTriggerStatements ["this && (BLUFOR_ConstantB) && ((count list BLUFOR_addTicket) < 0)", "BLUFOR_addTicketB = true", "BLUFOR_addTicketB = false"];
// ==================== End BLUFOR Addticket ====================
// ==================== REDFOR addTicket ====================
REDFOR_addTicket = createTrigger ["EmptyDetector", getMarkerPos "Objective_1"];
REDFOR_addTicket setTriggerArea [300, 200, 0, true];
REDFOR_addTicket setTriggerActivation ["EAST", "PRESENT", true];
REDFOR_addTicket setTriggerTimeout [1, 1, 1, true];
REDFOR_addTicket setTriggerStatements ["this && (REDFOR_ConstantB) && ((count list REDFOR_addTicket) > 0)", "REDFOR_addTicketB = true", "REDFOR_addTicketB = false"];
// ==================== End REDFOR Addticket ====================
//////////////////////////////////////////////////////////////////
// File: init_objectives.sqf
// By: TF5-SGM.Spyder
//////////////////////////////////////////////////////////////////
Sleep 1;
// ==================== Initialize Objectives ====================
If (isnil "BLUFOR_ConstantB") then { BLUFOR_ConstantB = false; };
If (isnil "REDFOR_ConstantB") then { REDFOR_ConstantB = false; };
If (isnil "BLUFOR_PresentB") then { BLUFOR_PresenttB = false; };
If (isnil "REDFOR_PresentB") then { REDFOR_PersentB = false; };
If (isnil "BLUFOR_addTicketB") then { BLUFOR_addTicketB = false; };
If (isnil "REDFOR_addTicketB") then { REDFOR_addTicketB = false; };
// ==================== End Initialize Objectives ====================
[] execVM "scripts\objective_sys\objective_status.sqf";
//////////////////////////////////////////////////////////////////
// File: ticket_count.sqf
// By: TF5-SGM.Spyder and Spooner
//////////////////////////////////////////////////////////////////
while {true} do
{
sleep 5;
if (BLUFOR_addTicketB) then
{
BLUFOR_TicketsB = BLUFOR_TicketsB +1; hint format ["BLUFOR_TicketsB = %1", BLUFOR_TicketsB];
};
if (REDFOR_addTicketB) then
{
REDFOR_TicketsB = REDFOR_TicketsB +1; hint format ["REDFOR_TicketsB = %1", REDFOR_TicketsB];
};
};
//////////////////////////////////////////////////////////////////
// File: player_death.sqf
// By: Beta (Beita)
//////////////////////////////////////////////////////////////////
// infinite loop
for [{_i=0}, {_i<1}, {_i=0}] do
{
waitUntil {!alive player}; //player has died
waitUntil {alive player}; //player has respawned
if (side player == WEST) then
{
BLUFOR_tickets = BLUFOR_tickets - 1; publicVariable "BLUFOR_tickets";
hint format["%1 BLUFOR Tickets remaining", BLUFOR_tickets];
}
else
{
REDFOR_tickets = REDFOR_tickets - 1; publicVariable "REDFOR_tickets";
hint format["%1 REDFOR Tickets remaining", REDFOR_tickets];
};
};
The constant boolean is needed to ensure the team controlling the zone must be in the zone with no exceptions to gain tickets.
A Present boolean will replace
((count list BLUFOR_addTicket) < 0)
his is required to make sure that the enemy doesn't stop the controling team from gaining points by jumping in the zone. "Present will be added tomorrow when i have a free second"
Thanks again to Spooner, Mando, Vipermaul, Beta (beita), and BarmyArmy!