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...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..