Jump to content
  • 0

Question

Posted
	public Collection<L2PcInstance> getAllgoodPlayers()
	{
		return _allgoodPlayers.values();
	}
	
	public Collection<L2PcInstance> getAllevilPlayers()
	{
		return _allevilPlayers.values();
	}

How can I turn this into an IF statement that checks how many players are on each faction? This is what I have now:

 

if ((goods - evils) >= 2)
{
player.sendMessage("There are too many players fighting for Blue. Try joining Red.");
}

This means that if for example there are 10 people on Good and 5 people on Evil:

10 - 5 = 5, which is greater than 2, so force the player to join Evil instead.

 

Obviously this IF statement is not working because 'goods' and 'evils' aren't integers. Any idea how I can make this work?

 

Thanks in advance!

-VonoxNL

 

9 answers to this question

Recommended Posts

  • 0
Posted

 

public Collection<L2PcInstance> getAllgoodPlayers()
	{
		return _allgoodPlayers.values();
	}
	
	public Collection<L2PcInstance> getAllevilPlayers()
	{
		return _allevilPlayers.values();
	}
How can I turn this into an IF statement that checks how many players are on each faction? This is what I have now:

 

 

if ((goods - evils) >= 2)
{
player.sendMessage("There are too many players fighting for Blue. Try joining Red.");
}
This means that if for example there are 10 people on Good and 5 people on Evil:

10 - 5 = 5, which is greater than 2, so force the player to join Evil instead.

 

Obviously this IF statement is not working because 'goods' and 'evils' aren't integers. Any idea how I can make this work?

 

Thanks in advance!

-VonoxNL

That mean good - evils is more than 2

You have to make check somethink like this

Like if good is more than evils || evils is more than goods

{

Msg

Return;

}

  • 0
Posted

That mean good - evils is more than 2

You have to make check somethink like this

Like if good is more than evils || evils is more than goods

{

Msg

Return;

}

So something like this?

if (goods > evils || evils > goods) {
      Message;
      Return;
}

But i can't use goods & evils like that right? Because they're not int's? This is what they look like in L2World.java

public Collection<L2PcInstance> getAllgoodPlayers()
{
return _allgoodPlayers.values();
}


public Collection<L2PcInstance> getAllevilPlayers()
{
return _allevilPlayers.values();
}
  • 0
Posted

So something like this?

 

if (goods > evils || evils > goods) {
      Message;
      Return;
}
But i can't use goods & evils like that right? Because they're not int's? This is what they look like in L2World.java

 

public Collection<L2PcInstance> getAllgoodPlayers()
{
return _allgoodPlayers.values();
}


public Collection<L2PcInstance> getAllevilPlayers()
{
return _allevilPlayers.values();
}
>= and i dont know what system you use so try to make the right check with your methods check the good and evil

And test them

  • 0
Posted (edited)

Most likely those good / evils stands for / represent those two methods which returns a number. You don't need any if statement as it already exists, no?

Edited by SweeTs
  • 0
Posted

you can do it in npc with like one check and if evil is 10 and good 3 hide button from evil 

 

if(good.size() > evil.size())

{

     html = html.replace("two match in good team");

}

else

{

    html = html.replace("use button here");

}

 

if(evil.size() > good.size())

{

    html = html.replace("two match in evil team");

}

else

{

   html = html.replace("use evil button here");

}

Guest
This topic is now closed to further replies.


  • Posts

    • L2jMobius has data oriented pathfinder since May. Already have "less memory" used for geodata since 3 weeks ago. Avoiding 1 GB less memory in geodata on latest clients. Not to mention rolling with an actual geodata generator since 3 weeks ago again. We also did actual benchmarks, tests with actual players, and decided to not use AI slop navmesh. I guess working only on a 10 year old client gives you a lot of free time and need to kill your boredom somehow... Need to show some progress somehow... Kinda get it... And unlike aCis we do release our full work every 4 months. So expect to actually see our work on this Christmas release.
    • 🎉 L2-SCRIPTS TURNS 20 🎉 This year marks our studio's 20th anniversary!   ▬▬▬▬▬▬▬▬▬▬   Two decades in the Lineage 2 private server market is a long run — we've seen chronicles, engines and trends come and go. We keep doing what we do best: builds, technical support, turnkey projects, website and engine development, personal account systems, anti-cheat and anti-bot protection, auto-donation systems, unique events, geodata — basically anything your project might need.   🎨 To mark the occasion, we figured it was the perfect time for a fresh look. Honestly, the haters deserve some credit too — they never sleep, and they gave us that extra push to finally update the visuals 😉 We kept the familiar structure and sections intact so nobody gets lost — just made everything more modern and easier on the eyes.   ▬▬▬▬▬▬▬▬▬▬   ⚠️ Spot any bugs or rough edges on the updated site? Let us know and we'll fix it right away. Thanks for being with us for 20 years. It only gets better from here 🚀   🌐 https://l2-scripts.ru   |   https://l2-scripts.com ✈️ https://t.me/L2scripts
    • A full MMORPG that runs in your browser. No download, no launcher, no account with anyone else — click the link and you are in the world. ▶ Play free: https://l2d.one Aden Chronicles is an isometric fantasy MMORPG built in the spirit of the old Lineage 2 servers: classes that branch as you grow, castles that change hands, and world bosses that the whole server has to deal with together. Not a single-player game with a leaderboard attached — one shared world, where the same monsters die once and the same castle has one lord. WHAT IS IN IT 7 regions and 245 hunting grounds, scaling from level 1 to 80 6 classes that branch into 24 professions, then Awakening at 60 201 skills, enchantable past their normal ceiling 174 monster types, raid bosses, and grand bosses shared by the entire server Castle sieges, clans with reputation and wars, the Grand Olympiad 23 armour sets across 6 grades, enchanting, augmentation with life stones Caves and mines you walk down into — tunnels, ore veins, a guardian at the bottom 14 islands reached by ship, 10 pets, from a wolf to a dragon hatchling THE TWO THAT EVERYONE FIGHTS Valakas the World-Flame — level 78, 900,000 HP Aetheron, Sky Sovereign — level 82, 1,400,000 HP They do not respawn for you. They respawn for everybody.   Video -->  
    • I personally like it a lot. I see this not as a replacement but as a supplementary client that can fill different type of gameplay. 
  • Topics

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