Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
AstralC

Radius player check help

Recommended Posts

I'm currently trying to make a script that calls another script when only side is alive in a certain area, i'm not exactly sure how to do this though. I tried this method below but it doesn't detect the player in the radius if they're in a vehicle? help. I mainly just need help detecting players on west and east or by these classnames when they're in a vehicle and out of it in the specified radius.

 

westPlayers = [11205.2,8715.09,0.00143433] nearEntities ["B_Competitor_F", 3000];

 

eastPlayers = [11205.2,8715.09,0.00143433] nearEntities ["O_G_Soldier_Unarmed_F", 3000];

 

noEast = (count eastPlayers > 0) && !(count westPlayers > 0); 

 

noWest = !(count eastPlayers > 0) && (count westPlayers > 0)

 

waitUntil

{

         (noEast || noWest);

};

 

execVM "scripts\endround.sqf";

Share this post


Link to post
Share on other sites
21 minutes ago, AstralC said:

I mainly just need help detecting players on west and east or by these classnames when they're in a vehicle and out of it in the specified radius.

 

With nearEntities you can search using an array of string types.

westPlayers = [11205.2,8715.09,0.00143433] nearEntities [["Man", "Air", "Car", "Motorcycle", "Tank"], 3000];
eastPlayers = [11205.2,8715.09,0.00143433] nearEntities [["Man", "Air", "Car", "Motorcycle", "Tank"], 3000]; 

 

There may be another method.
Something like:

_bool = true;

while {_bool} do
{
	sleep 2;

	_pos = [11205.2,8715.09,0]; 
	_rad = 3000; 
		 
	_WestInZone = west countSide (allUnits inAreaArray [ _pos, _rad, _rad, 0, false, -1 ]);
	_EastInZone = east countSide (allUnits inAreaArray [ _pos, _rad, _rad, 0, false, -1 ]);
		
	if (_WestInZone == 0) exitWith { _bool = false; hint "EAST WINS!" };
	if (_EastInZone == 0) exitWith { _bool = false; hint "WEST WINS!" };
};

 

  • Like 2

Share this post


Link to post
Share on other sites

×