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

    • its not the html.   its the "calling" of it (like Salty said) and i cant figure it out...
    • 🎅 New Year's discount: 20% off - all of December! Price: 500$ 400$   Discount is valid from 05.12.2023 to 31.12.2023 (inclusive)
    • Hello everyone! We are selling a unique High Five server that has been developed for years and is still being finalized and has not been launched anywhere except our projects. We guarantee you that all backdoors, critical bugs and errors have been fixed and all minor errors that have been found to this day have also been fixed.   The server has full working locations, working quests, instance zones, a full working community board, bots that cannot be distinguished from real players, multilingual mode (ru and en), various services and other mechanisms, absolutely with full finished configs, custom services, antibot protection on the server side and on the client side, in a word, you take it and launch your project. Many new things have also been added to the server, armor, weapons, that you can run both the classic server and the server with the additions.   One of the unique developments of this server is bots that are 99.9% created and developed like real players. On this build we kept 800+ live players (350+ from them unique players, the rest their dualboxes) and 2000 bots, almost 3000 players without any problems and errors. Features of these bots: 1. Write in chats, all chats: general chat, shout, trade, clan. You can change, add, delete the chat text at any time 2. Walk, go to npcs, kill / attack mobs, attack players, attack pvp / pk. 3. Can pvp, pk, participate in Events. 4. Invite in clans. 5. Can teleport, use items, walk in the towns. 6. Can show in the statistics. 7. Can equip / unequip items weapons, accessories, armors. 8. In a word, these bots are 100% implemented as real players. And the most important thing is that you can control them and control them the way you control real players. We will also teach you how to operate it the way you want. Soon I will show you in a video some of the abilities of these bots!   When purchasing, we sell you the files that are currently running on our live projects, that is, a completely ready-made server that you will buy and launch your project. Prices: 1. Build. A completely ready Build for launching your project, with configured, community board design, rates x10,x25,x50,x75,x100,x1200, various bot files that were created throughout the life of the server and all other files that we have developed and modified to this days Also: 1 month free technical support, free learning bot management, free learning server details that you don't understand. Without IP binding, without online restrictions and also without restrictions on the number of bot launches. Price: 990$   2. Source. We are ready to share with you the latest version and revision of the server source, with all the files and changes that have occurred until today. Price and your conditions: Negotiable.   Besides this we have Remastered - High Five and Reworked - High Five build/sources, which are also unique in their kind and were developed through many sleepless nights and launched only in our project, you can come and test by going to our project, the link will be at the end of the topic.   We also present you with a service about creating your unique project from scratch (using our servers) and will help you realize your long-time dream for little money, but a high-quality project! Price and your conditions: Negotiable.   Test servers are not available to everyone, but we give you a link to a live project so that you can go and check everything without any interference or doubts. For real buyers, of course we will run test servers with all administrator rights! Link for testing observations: http://global-game.su/ or https://global-game.su/ For purchasing contact me: Telegram: t.me/magellanjg Discrod: jacob.gudkov                
    • its pretty obvious that you already say whats wrong and it is indeed the wrong but , you do not see it.. when the error is super clear!  as the friend above said, you are not parsing the html so it gives you "empty" or "faulty" html as main 🙂 cause it doesnt even exist!
    • Skype: Live:LargeSells   Discord: LargeSeLLs#7167 DiscUniqueID: 321388776200994816
  • Topics

×
×
  • Create New...