L2JMobius

CT0 pvp_pk title

dramaa · 10 · 345

Offline dramaa

  • Elder
  • ****
    • Posts: 127
so i added pvp pk title and its working except for updating it in real time, i mean when i am getting pvp or pk and i restart, i am getting correct title but, not working in real time, help me if you can.

Player.java
Code: [Select]
/**
* Update title.
*/
public void updateTitle()
{
setTitle(Config.PVP_TITLE_PREFIX + "[" + getPvpKills() + "]" + Config.PK_TITLE_PREFIX + "[" + getPkKills() + "]");
}
Code: [Select]
if (Config.PVP_PK_TITLE)
{
updateTitle();
}
Config.java

Code: [Select]
public static boolean PVP_PK_TITLE;

public static String PVP_TITLE_PREFIX;
public static String PK_TITLE_PREFIX;


Online CostyKiller

  • Distinguished King
  • *****
    • Posts: 968
We already have such function for titles, check this line in player.java

Code: [Select]
public void updatePvpTitleAndColor(boolean broadcastInfo)


Offline dramaa

  • Elder
  • ****
    • Posts: 127
We already have such function for titles, check this line in player.java

Code: [Select]
public void updatePvpTitleAndColor(boolean broadcastInfo)

i am not pro but, what i see, seems like giving titles when reaching certain amount of pvp, and i want [pvp][pk] title all the time :/ changes i made showing pvp-pk  but, not in real time, it's need to be restarted to show real numbers after pvp


Online CostyKiller

  • Distinguished King
  • *****
    • Posts: 968
That setting I told you to check should work in realtime, I told you to check it because it sends some packets for that realtime you want to work... and you can use it on your code.


Offline dramaa

  • Elder
  • ****
    • Posts: 127
That setting I told you to check should work in realtime, I told you to check it because it sends some packets for that realtime you want to work... and you can use it on your code.

i tried it like that
Code: [Select]
public void updateTitle(boolean broadcastInfo)

{
setTitle(Config.PVP_TITLE_PREFIX + "[" + getPvpKills() + "]" + Config.PK_TITLE_PREFIX + "[" + getPkKills() + "]");
}
but nothing, can you help me and tell me how exactly i have to make it work? :/


Online CostyKiller

  • Distinguished King
  • *****
    • Posts: 968
Code: [Select]
public void updateTitle()

{
setTitle(Config.PVP_TITLE_PREFIX + "[" + getPvpKills() + "]" + Config.PK_TITLE_PREFIX + "[" + getPkKills() + "]");
                broadcastTitleInfo();
}

This should work...


Offline dramaa

  • Elder
  • ****
    • Posts: 127
Code: [Select]
public void updateTitle()

{
setTitle(Config.PVP_TITLE_PREFIX + "[" + getPvpKills() + "]" + Config.PK_TITLE_PREFIX + "[" + getPkKills() + "]");
                broadcastTitleInfo();
}

This should work...

not, when i applied this change, i was getting error when trying to log in


Online CostyKiller

  • Distinguished King
  • *****
    • Posts: 968

Offline dramaa

  • Elder
  • ****
    • Posts: 127
show the error...

its critical error, i am choosing character and when i am entering world, it's getting error, i bring back old libs to make sure it was the problem, and it is :/


Online CostyKiller

  • Distinguished King
  • *****
    • Posts: 968
Try using the already existing mod and if that works fine go from there and edit it further to match what you want.
If with the default mod you still get critical error then is client related problem or limit...