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..
Question
VonoxNL
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