Jump to content
  • 0

[HELP] Radius Check


Question

Posted

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

2 answers to this question

Recommended Posts

  • 0
Posted

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.


×
×
  • Create New...