Skip to content

[HELP] Radius Check

Featured Replies

Hi anyone can help me im trying to create a condition that will check if player is near the party leader.

 

I have a cicle checking all party members but i can't figure how to create a condition that will check if player is near lets say in an area of 400, i knew how to do it but forgot.

 

Thx in advance

Search for isInsideRadius L2Character

Something like this...

 


private boolean checkInRangeLeader(L2PcInstance player, Integer _range)
{
	L2Party party = player.getParty();
	if (party == null)
	{
		return false;
	}
	if (!player.isInsideRadius(party.getLeader(), _range, true, true))
	{
		return false;
	}
return true;
}

 

Then you'd use it like this

if (checkInRangeLeader(whoever,1000) )
{
   do whatever.
}

 

Just an example... Very simple to do though.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.