View Single Post
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 02-19-2018 , 08:01   Re: Detected player problem
Reply With Quote #2

That's a for-loop. Don't touch it.
You tell the code that it can run the loop as long as e is over g_iMaxPlayers.
e is however 1, making the statement false to begin with, so it does nothing.
Since the loop never runs, the variables X[0] (Terrorists) and X[1] (CT) are both 0, making the if-statement impossible as well.

What you want to change is this line:
if((X[0] == 1) && (X[1] == 1))
It says:
if ( terrorists == 1 AND counter_terrorists == 1 ) do...

Perhaps you want to change it to:
if ( X[0] <= 2 && X[1] <= 2 )
But then it would react to 0 players as well. So just to be safe...
if ( 1 <= X[0] <= 2 && 1 <= X[1] <= 2 )
Which means terrorists have to be more than or equal to 1 and also less than or equal to 2. Basically setting a span between 1 and 2. Same with CT.
You can change the numbers to whatever you want.

Last edited by Black Rose; 02-19-2018 at 08:05.
Black Rose is offline