Jump to content
  • 0

Max clan members


Amanda55

Question

Where i make max 2 clan members

 

	/**
 * @param pledgeType the Id of the pledge type.
 * @return the maximum number of members allowed for a given {@code pledgeType}.
 */
public int getMaxNrOfMembers(int pledgeType)
{
	int limit = 2;

	switch (pledgeType)
	{
		case 0:
			switch (getLevel())
			{
				case 3:
					limit = 2;
					break;
				case 2:
					limit = 2;
					break;
				case 1:
					limit = 2;
					break;
				case 0:
					limit = 2;
					break;
				default:
					limit = 2;
					break;
			}
			break;
		case -1:
			limit = 2;
			break;
		case 100:
		case 200:
			switch (getLevel())
			{
				case 11:
					limit = 2;
					break;
				default:
					limit = 2;
					break;
			}
			break;
		case 1001:
		case 1002:
		case 2001:
		case 2002:
			switch (getLevel())
			{
				case 9:
				case 10:
				case 11:
					limit = 2;
					break;
				default:
					limit = 2;
					break;
			}
			break;
		default:
			break;
	}

	return limit;
}

 

 

Don't work

 

ty for help

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

Depends on clan lvl & how much royals clan does have... but use this and give me feed back...

	public int getMaxNrOfMembers(int pledgetype)
{
	int limit = 0;

	switch (pledgetype)
	{
	case 0:
		switch (getLevel())
		{
		case 4:
			limit   = 0;
			break;
		case 3:
			limit   = 0;
			break;
		case 2:
			limit   = 0;
			break;
		case 1:
			limit   = 0;
			break;
		case 0:
			limit   = 0;
			break;
		default:
			limit   = 2;
		break;
		}
		break;
	case -1:
	case 100:
	case 200:
		limit   = 0;
		break;
	case 1001:
	case 1002:
	case 2001:
	case 2002:
		switch (getLevel())
		{
			case 9:
			case 10:
				limit	= 0;
				break;
			default:
				limit   = 0;
				break;
		}
		break;
	default:
		break;
        }

        return limit;
}

Link to comment
Share on other sites

  • 0

Create a condicion in RequestJoinPledge..

 

if (activeChar.getClan().getMembersCount() >= "NUM")

{

activeChar.sendMessage("Your clan is full!.");

return;

}

 

NUM = the number you want of max clan members in a clan.

 

Hope i help.

Link to comment
Share on other sites

  • 0

Create a condicion in RequestJoinPledge..

 

if (activeChar.getClan().getMembersCount() >= "NUM")

{

activeChar.sendMessage("Your clan is full!.");

return;

}

 

NUM = the number you want of max clan members in a clan.

 

Hope i help.

 

why, to make it more heavier? He already has what he needs.

Link to comment
Share on other sites

  • 0

Stewie  don't work :/

 

 

exity  where i put the code in:

 

 public final class RequestJoinPledge extends L2GameClientPacket
{
private static final String _C__26_REQUESTJOINPLEDGE = "[C] 26 RequestJoinPledge";

private int _target;
private int _pledgeType;

@Override
protected void readImpl()
{
	_target = readD();
	_pledgeType = readD();
}

@Override
protected void runImpl()
{
	final L2PcInstance activeChar = getClient().getActiveChar();
	if (activeChar == null)
	{
		return;
	}

	final L2Clan clan = activeChar.getClan();
	if (clan == null)
	{
		return;
	}

	final L2PcInstance target = L2World.getInstance().getPlayer(_target);
	if (target == null)
	{
		activeChar.sendPacket(SystemMessageId.YOU_HAVE_INVITED_THE_WRONG_TARGET);
		return;
	}

	if (!clan.checkClanJoinCondition(activeChar, target, _pledgeType))
	{
		return;
	}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                             if (activeChar.getClan().getMembersCount() >= "NUM")                         ( HERE ) ?
                             {
                             activeChar.sendMessage("Your clan is full!.");
                             return;
                             }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	if (!activeChar.getRequest().setRequest(target, this))
	{
		return;
	}

	final String pledgeName = activeChar.getClan().getName();
	final String subPledgeName = (activeChar.getClan().getSubPledge(_pledgeType) != null ? activeChar.getClan().getSubPledge(_pledgeType).getName() : null);
	target.sendPacket(new AskJoinPledge(activeChar.getObjectId(), subPledgeName, _pledgeType, pledgeName));
}

public int getPledgeType()
{
	return _pledgeType;
}

@Override
public String getType()
{
	return _C__26_REQUESTJOINPLEDGE;
}
}

Link to comment
Share on other sites

  • 0

Small Error

 

if (activeChar.getClan().getMembersCount() >= "2")                ////  The operator >= is undefined for the argument type(s) int, string  ////

 

 

 

And Compil error :

 

:72: error: bad operand types for binary operator '>='

    [javac] if (activeChar.getClan().getMembersCount() >= "2")

    [javac]                                           ^

    [javac]  first type:  int

    [javac]  second type: String

    [javac] 1 error

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • rename the l2.bin into l2.exe
    • L2LIVE.PRO- Dynamic Mid-rates Essence Seven Signs GRAND OPENING - July 5, 20:00 GMT+3 (EEST) TEST SERVER IS OPEN - COME AND CHECK IT OUT TODAY! Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu   Server description * EXP/SP: Dynamic (x1- x100 based on your level, *before* Sayha and EXP buffs * Adena: x50 / Item Drop: x10 / Fishing EXP increased / Attribute EXP increased * Simplified gameplay to stay in the loop while not spending hours and hours farming * Starter Pack containing very useful items for beginners * MP replenishing potions with auto-consumption * No overpowered donations L2LIVE shop * All spellbook coupons, pet spellbook coupons and master books are sold via Game Assistant * Additionally you can buy SP pouches, enchanted talismans, pet training guides and various other consumables for Adena and L-Coin * More items such as cloaks, more talismans, agathions, belts, pendants, enchantment scrolls of various grades, evolution stones, etc will be added! Shop server as a shortcut, and all retail-like ways of earning items are still here! L-Coins * Drops with small change and in random amounts from Lv60+ monsters  * All raidbosses drop random amount of L-Coin Pouches generating up to 420 Lcoin per unit. **Grand Olympiad and Events** * Grand Olympiad is held week day * Format is 1v1, unlimited weekly fights  * Heroes are declared weekly at Sunday * There are three automated events - TvT, CTF and Deathmatch, running at evenings * Orc Fortress, Battle with Balok, Keber Hunter, Archievements Box, Daily Gift Calendar provisional events are active too Custom user commands * .offlineplay command, your character will keep playing till death or server restart * .offlineshop command, keeps your shop sitting until all items are purchased * .apon / .apoff - enable/disable HP/MP autoconsume And lots of other small improvements are waiting for you!   Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu
    • I can use this folder system for High Five offline server?   The folder does not have a l2.exe file.   Thank you very much if anyone can help me.   https://drive.google.com/file/d/13kU-g_4JJ-sP-kg2F7pqkUOVKmQdubFm/view
  • Topics

×
×
  • Create New...