Jump to content
Sign in to follow this  
samatra

Check if any players are nearby

Recommended Posts

Hello. How can I check if there are any players are nearby certain position? And I mean players only, not AI. Thanks.

Share this post


Link to post
Share on other sites

In trigger:

condition:

player distance ap <500

on act:

hint "There is a player in sector"

ap-name of object on map, car or something.

Player-should work for all units controled by players

500-distance from object

Share this post


Link to post
Share on other sites

({_x distance [color="#000080"]object[/color] < 5 && isPlayer _x} count units [color="#000080"]GroupName[/color]) > 0

Or instead of units GroupName you could use playableUnits, but when testing this in the editor you'll need this in your init:

if !ismultiplayer then { playableunits = switchableunits };

because playableunits is multiplayer-only.

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  

×