Jump to content

Question

Posted

Hello guys..
I would like to find out if it is possible to make a gatekeeper that will teleport players that are only in a party that has a specific number of member
Example ( If a player is in a 3 member party he can teleport ) if he is not give him a message that says you are not in a party or your party lacks of members
Waiting for an answer pls

7 answers to this question

Recommended Posts

  • 0
Posted (edited)


L2Party party = player.getParty();

 

if (party.getMemberCount() < 3)

{

       player.sendMessage("You need a party with at least 3 members.");

       return;

}

Edited by SweeTs
  • 0
Posted
L2Party party = player.getParty();
 
if (party.getMemberCount() < 3)
{
       player.sendMessage("You need a party with at least 3 members.");
       return;
}

 

NullPointerException

  • 0
Posted (edited)

NullPointerException

You rly expect me to c/p rdy code cuz someone wants it ? :troll:

 

Btw, he was asking only for that and it's obvious to check if the party is not null, so well.. :)

Edited by SweeTs
  • 0
Posted

You rly expect me to c/p rdy code cuz someone wants it ? :troll:

 

Okay, okay.. let it be..

&& player.getParty() != null

Btw, he was asking for that, so well.. :)

 

You still get npe with that one :p

 

it must be player.getParty() != null && 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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