Jump to content
  • 0

[Help]Java prob.


Question

Posted

Hi all.

I want to make a custom title based on pvp point. i use This system  but i have 1 problem here.

 

 

+            if ((pvpKillAmount >= (Config.PVP_AMOUNT1)) && (pvpKillAmount < (Config.PVP_AMOUNT2)))

+            {

+               getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AMOUNT1);

 

 

If i use.. setTitle i got an error (i can't fix with eclpise quick fix)

15 answers to this question

Recommended Posts

  • 0
Posted

Make sure that your config is an int value.

Otherwise I can't understand the reason for this error to appear.

 

He said that he cant fix it via eclipse quick fix (and in this case there should be "Change to String")

 

But maybe You're right.

 

Or maybe he is blind.

  • 0
Posted

He said that he cant fix it via eclipse quick fix (and in this case there should be "Change to String")

 

But maybe You're right.

 

Or maybe he is blind.

 

or maybe he's oppening files as text editors, so eclipse doesn't provide quick fixes ;] (I used to do that at my first steps with eclipse)

  • 0
Posted

or maybe he's oppening files as text editors, so eclipse doesn't provide quick fixes ;] (I used to do that at my first steps with eclipse)

 

Maybe, who knows.

 

I was (Still I'm) sure that he was/is enough smart..

  • 0
Posted

Hi all.

I want to make a custom title based on pvp point. i use This system  but i have 1 problem here.

 

 

+            if ((pvpKillAmount >= (Config.PVP_AMOUNT1)) && (pvpKillAmount < (Config.PVP_AMOUNT2)))

+            {

+              getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PVP_AMOUNT1);

 

 

If i use.. setTitle i got an error (i can't fix with eclpise quick fix)

 

If you want to use "setTitle" you need to remove getAppearance()

  • 0
Posted

If you want to use "setTitle" you need to remove getAppearance()

 

He's talking about the setTitleColor.

He mentions that he tried the setTitle as a fix, but it didn't help at all.

  • 0
Posted

No i am talking about setTitle...

 

 

With what i need to replace getAppearance() ????

 

pf, with nothing.

Ex.: player.setTitle(String);

Otherwise it should be

player.getAppearance().setTitleColor(FFFF00); //or smth similar with this, but remember: we need int values.

  • 0
Posted

off you don't understund. i don't want title color. i want when you make 20 pvp for example... your title wil be Warrior... etc.

i use that because i don't know java ... and i edit only color system.. because of that is TITLE_COLOR_FOR_PVP_AMOUNT1 etc..

  • 0
Posted

off you don't understund. i don't want title color. i want when you make 20 pvp for example... your title wil be Warrior... etc.

Finally an explanation.

Then the config's name/purpose is wrong.

It should be:

setTitle(String); //and were I say String, I mean a text, not numbers that form integers or floating points!

  • 0
Posted

This no is ok?

# Pvp Amount, Title & color level 1.
PvpAmount1 = 50
TitleForAmount1 = Warrior

# Pvp Amount, Title & color level 2.
PvpAmount2 = 100
PkAmount2 = 100
TitleForAmount2 = Soldier

# Pvp Amount, Title & color level 3.
PvpAmount3 = 150
TitleForAmount3 = Elite Soldier

# Pvp Amount, Title & color level 4.
PvpAmount4 = 200
TitleForAmount4 = Gladiator

# Pvp Amount, Title & color level 5.
PvpAmount5 = 250
TitleForAmount1 = Veteran

# Pvp Amount, Title & color level 6.
PvpAmount6 = 300
TitleForAmount6 = Champion

# Pvp Amount, Title & color level 7.
PvpAmount7 = 350
TitleForAmount7 = Commander

# Pvp Amount, Title & color level 8.
PvpAmount8 = 400
TitleForAmount8 = Master

# Pvp Amount, Title & color level 9.
PvpAmount9 = 450
TitleForAmount9 = Assassin

# Pvp Amount, Title & color level 10.
PvpAmount10 = 500
TitleForAmount10 = Hero

	public static boolean   PVP_TITLE_AND_COLOR_SYSTEM_ENABLED;
public static boolean   PK_COLOR_SYSTEM_ENABLED;
public static int      PVP_AMOUNT1;
public static int      TITLE_COLOR_FOR_PVP_AMOUNT1;
public static int      PVP_AMOUNT2;
public static int      TITLE_COLOR_FOR_PVP_AMOUNT2;
public static int      PVP_AMOUNT3;
public static int      TITLE_COLOR_FOR_PVP_AMOUNT3;
public static int      PVP_AMOUNT4;
public static int      TITLE_COLOR_FOR_PVP_AMOUNT4;
public static int      PVP_AMOUNT5;
public static int      TITLE_COLOR_FOR_PVP_AMOUNT5;
public static int      PVP_AMOUNT6;
public static int      TITLE_COLOR_FOR_PVP_AMOUNT6;
public static int      PVP_AMOUNT7;
public static int      TITLE_COLOR_FOR_PVP_AMOUNT7;
public static int      PVP_AMOUNT8;
public static int      TITLE_COLOR_FOR_PVP_AMOUNT8;
public static int      PVP_AMOUNT9;
public static int      TITLE_COLOR_FOR_PVP_AMOUNT9;
public static int      PVP_AMOUNT10;
public static int      TITLE_COLOR_FOR_PVP_AMOUNT10;

				PVP_TITLE_AND_COLOR_SYSTEM_ENABLED      = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePvPColorSystem", "false"));
				   
	            PVP_AMOUNT1                             = Integer.parseInt(L2JModSettings.getProperty("PvpAmount1", "50"));
				TITLE_COLOR_FOR_PVP_AMOUNT1             = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount1", "Warrior"));
				PVP_AMOUNT2                             = Integer.parseInt(L2JModSettings.getProperty("PvpAmount2", "100"));
				TITLE_COLOR_FOR_PVP_AMOUNT2             = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount2", "Soldier"));
				PVP_AMOUNT3                             = Integer.parseInt(L2JModSettings.getProperty("PvpAmount3", "150"));
				TITLE_COLOR_FOR_PVP_AMOUNT3             = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount3", "Elite Soldier"));
				PVP_AMOUNT4                             = Integer.parseInt(L2JModSettings.getProperty("PvpAmount4", "200"));
				TITLE_COLOR_FOR_PVP_AMOUNT4             = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount4", "Gladiator"));
				PVP_AMOUNT5                             = Integer.parseInt(L2JModSettings.getProperty("PvpAmount5", "250"));
				TITLE_COLOR_FOR_PVP_AMOUNT5             = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount5", "Veteran"));
				PVP_AMOUNT6                             = Integer.parseInt(L2JModSettings.getProperty("PvpAmount6", "300"));
				TITLE_COLOR_FOR_PVP_AMOUNT6             = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount6", "Champion"));
				PVP_AMOUNT7                             = Integer.parseInt(L2JModSettings.getProperty("PvpAmount7", "350"));
				TITLE_COLOR_FOR_PVP_AMOUNT7             = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount7", "Commander"));
				PVP_AMOUNT8                             = Integer.parseInt(L2JModSettings.getProperty("PvpAmount8", "400"));
				TITLE_COLOR_FOR_PVP_AMOUNT8             = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount8", "Master"));
				PVP_AMOUNT9                             = Integer.parseInt(L2JModSettings.getProperty("PvpAmount9", "450"));
				TITLE_COLOR_FOR_PVP_AMOUNT9             = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount9", "Assassin"));
				PVP_AMOUNT10                             = Integer.parseInt(L2JModSettings.getProperty("PvpAmount10", "500"));
				TITLE_COLOR_FOR_PVP_AMOUNT10             = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount10", "Hero"));

public void updatePvPTitle(int pvpKillAmount)
   {
      if (Config.PVP_TITLE_AND_COLOR_SYSTEM_ENABLED)
      {
         //Check if the character has GM access and if so, let them be.
         if (isGM())
            return;
         {
            if ((pvpKillAmount >= (Config.PVP_AMOUNT1)) && (pvpKillAmount < (Config.PVP_AMOUNT1)))
            {
               getAppearance().setTitle(Config.TITLE_COLOR_FOR_PVP_AMOUNT1);
            }
            if ((pvpKillAmount >= (Config.PVP_AMOUNT2)) && (pvpKillAmount < (Config.PVP_AMOUNT2)))
            {
               getAppearance().setTitle(Config.TITLE_COLOR_FOR_PVP_AMOUNT2);
            }
            if ((pvpKillAmount >= (Config.PVP_AMOUNT3)) && (pvpKillAmount < (Config.PVP_AMOUNT3)))
            {
               getAppearance().setTitle(Config.TITLE_COLOR_FOR_PVP_AMOUNT3);
            }
            if ((pvpKillAmount >= (Config.PVP_AMOUNT4)) && (pvpKillAmount < (Config.PVP_AMOUNT4)))
            {
               getAppearance().setTitle(Config.TITLE_COLOR_FOR_PVP_AMOUNT4);
            }
            if ((pvpKillAmount >= (Config.PVP_AMOUNT5)) && (pvpKillAmount < (Config.PVP_AMOUNT5)))
            {
               getAppearance().setTitle(Config.TITLE_COLOR_FOR_PVP_AMOUNT5);
            }
            if ((pvpKillAmount >= (Config.PVP_AMOUNT6)) && (pvpKillAmount < (Config.PVP_AMOUNT6)))
            {
               getAppearance().setTitle(Config.TITLE_COLOR_FOR_PVP_AMOUNT6);
            }
            if ((pvpKillAmount >= (Config.PVP_AMOUNT7)) && (pvpKillAmount < (Config.PVP_AMOUNT7)))
            {
               getAppearance().setTitle(Config.TITLE_COLOR_FOR_PVP_AMOUNT7);
            }
            if ((pvpKillAmount >= (Config.PVP_AMOUNT8)) && (pvpKillAmount < (Config.PVP_AMOUNT8)))
            {
               getAppearance().setTitle(Config.TITLE_COLOR_FOR_PVP_AMOUNT8);
            }
            if ((pvpKillAmount >= (Config.PVP_AMOUNT9)) && (pvpKillAmount < (Config.PVP_AMOUNT9)))
            {
               getAppearance().setTitle(Config.TITLE_COLOR_FOR_PVP_AMOUNT9);
            }
            else if (pvpKillAmount >= (Config.PVP_AMOUNT10))
            {
               getAppearance().setTitle(Config.TITLE_COLOR_FOR_PVP_AMOUNT10);
            }
         }
      }
   }

Guest
This topic is now closed to further replies.


  • Posts

    • L2Elixir – Patch 4 Is Live!   We’re working non-stop, day and night, to deliver the best possible quality and bring back what made L2Elixir special. This project is built with passion, not shortcuts — for the old-school players who remember, and the new ones who want to experience it properly. Thank you for being part of the journey. Together, we’re making L2Elixir great again ❤️ The legends never fade.    ⚙️ General Enabled Class Change service (same class type only) ALT + B → Services → Character Development Enabled Shift + Click on Treasure Chests Players can now identify real chests (Adena, scroll drops) and use Key / Unlock Event deaths now cancel only debuffs, All self buffs are preserved, fixes issues with Root and similar effects Bladedancer class can now log in even when Max Clients (2) is reached. Since an active Bladedancer is not available for every damage dealer and some players tried to abuse this via VPN or a second PC, this feature was added to keep things fair. protections applies, requires testing!    🎒 Items Crystallizing enchanted items now gives the correct increased crystal amount (retail-like behavior) Removed Agathion Seal Bracelet: Rudolph from Santa rewards (Gracia Final item) Added Dualsword Craft Stamp into Milestone Exchange list    🧙 Skills Fixed Banish Undead lethal chance Hot Springs Malaria and similar effects now level up faster while being attacked
    • thats new SEO level tricks you know nothing of noob - bottom line: exposed.
    • Warning: This guy is a big scammer, trying to sell everything, advertising for servers etc. That's his mail address evgesha.nrnr@gmail.com , stay away!   @Atom @Celestine
    • Warning: This guy is a big scammer, trying to sell everything, advertising for servers etc. That's his mail address evgesha.nrnr@gmail.com , stay away! @Celestine @Atom
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock