Jump to content
Sign in to follow this  
alleycat

BIS_fnc_respawnTickets fail

Recommended Posts

Wrote a ticket tracking script. But the conditions fail

sleep 5;
_txt = "Ticket-Tracker: Starting to track tickets";
_txt remoteExec ["systemchat"]; 


_tickets_blue 	= 	[west,0] call BIS_fnc_respawnTickets;
_tickets_green 	= 	[resistance,0] call BIS_fnc_respawnTickets;

while {(_tickets_blue > 1) or (_tickets_green > 1)}	do
{

	_tickets_blue 	= 	[west,0] call BIS_fnc_respawnTickets;
	_tickets_green 	= 	[resistance,0] call BIS_fnc_respawnTickets;
	sleep 2;
	
	
};


_txt = "One team out of tickets, ending mission";
_txt remoteExec ["systemchat"]; 

The script only works if the while condition only checks for one teams tickets, like this:

while {_tickets_blue > 1}	do

Why is the or condition faulty?

 

 

EDIT because it needs AND instead of OR.

moderator please remove

Share this post


Link to post
Share on other sites

Private ["_tickets_blue", "_tickets_green"];

Should solve this problem.

It seems like the variables are out of scope.

Share this post


Link to post
Share on other sites

Private ["_tickets_blue", "_tickets_green"];

Should solve this problem.

It seems like the variables are out of scope.

Thanks for the advice, but the scope was not the issue.I used  OR instead of AND

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  

×