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

    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
    • PERFECT PERSPECTIVE IS ALMOST ALWAYS A DEATH SENTENCE ▪ Think if the document lies perfectly flat and everything is “level” it’ll be fine? Most of the time, that’s exactly what gives away the fake. Real smartphones, especially wide-angle cameras, always add natural distortions: - Slight warping at the edges of the document - Perspective distortions in the corners - Light curvature of the plane due to distance and shooting angle When everything is perfectly flat and geometrically flawless — algorithms and verifiers immediately recognize a “staged scene.” ▪ A genuine shot is never mathematically perfect. It’s these small lens distortions that make the frame look alive and believable.  Want perspective that won’t raise questions even from the most demanding verifiers? Write to us — we’ll create geometry that looks like it was shot with a real phone in real conditions. › TG: @mustang_service_ms ( https:// t.me/ mustang_service_ms ) › Channel: Mustang Service ( https:// t.me/ +JPpJCETg-xM1NjNl ) #documents #drawing #perspective #editing #geometry
    • Gemini Pro 18 Month Personal Gmail Upgrade Available We are now accepting new orders for Gemini Pro + Google One AI Pro 18 Month Plan.   Plan Details: ✅ 18 Months Validity ✅ Upgrade on Your Personal Gmail ✅ 5TB Google One Storage ✅ Gemini Pro / Google AI Pro Access ✅ Veo 3, NotebookLM, Google AI Features ✅ Family Sharing Support where available ✅ Fast Delivery: 10 minutes to 24 hours ✅ 24/7 KloudItem Support   Price: $15 One Time Payment   Important: Stock is limited, so please check availability before ordering.   Order & Support: Order from KloudItem or contact us through our official support channel. ------------------------------------------- CONTACT Order Here: BUY GEMINI PRO Email: support@klouditem.com Telegram Channel: @klouditemcom Telegram Support: klouditem All Contact: https://linktr.ee/klouditem Website: https://klouditem.com Hours: 24/7 -- Always online
    • Hello everyone,   A quick update from the Emerge team. The official launch of Emerge Eclipse x10 is just around the corner and we are currently finishing the final preparations to ensure a smooth and stable opening for all players. Our team has been working on performance improvements, network optimizations, and additional infrastructure to provide the best possible experience from day one.   🚀 Launch Date: 7 June 2026 🕕 Launch Time: 18:00 CET We would like to invite everyone to join our Discord community where all announcements, updates, events, and support information are posted first. 🌐 Website: https://l2emerge.com 💬 Discord: https://discord.gg/l2emerge Thank you for all the support and feedback during the preparation phase. We look forward to seeing both new and veteran Lineage II players on launch day. See you soon on Emerge!
  • 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..