Waster Posted December 1, 2014 Posted December 1, 2014 (edited) Hello i would like to do this.. when i write on npc %online% npc shows online players how can i do that? for example <center><font color="00FF00">Online Players: %online% </font></center> .. if you know what i mean. Edited December 1, 2014 by xNemesis
0 Devlin Posted December 1, 2014 Posted December 1, 2014 Go at L2Npc.java Find this method: public void showChatWindow(L2PcInstance player, int val) After this: html.replace("%objectId%", getObjectId()); Add this: html.replace("%online%", L2World.getInstance().getAllPlayersCount()); So, %online% can be used everywhere (at every single NPC).
0 Waster Posted December 1, 2014 Author Posted December 1, 2014 Hello i would like to do this.. when i write on npc %online% npc shows online players how can i do that? for example <center><font color="00FF00">Online Players: %online% </font></center> .. if you know what i mean. where is this l2npc.java on eclipse (L2J Frozen)
0 Waster Posted December 1, 2014 Author Posted December 1, 2014 Go at L2Npc.java Find this method: public void showChatWindow(L2PcInstance player, int val) After this: html.replace("%objectId%", getObjectId()); Add this: html.replace("%online%", L2World.getInstance().getAllPlayersCount()); So, %online% can be used everywhere (at every single NPC). Doesnt work , i open L2NpcInstance i cant find what you say.. pack L2j frozen
0 mawtaw7 Posted December 1, 2014 Posted December 1, 2014 Doesnt work , i open L2NpcInstance i cant find what you say.. pack L2j frozen html.replace("%objectId%", String.valueOf(getObjectId())); @l2npcinstance for frozen. u could search ofc but no.
0 Waster Posted December 1, 2014 Author Posted December 1, 2014 html.replace("%objectId%", String.valueOf(getObjectId())); @l2npcinstance for frozen. u could search ofc but no. yes i add this exactly after this and i got error.
0 Nightw0lf Posted December 1, 2014 Posted December 1, 2014 html.replace("%online%", String.valueOf(L2World.getInstance().getAllPlayersCount()));
0 Waster Posted December 1, 2014 Author Posted December 1, 2014 html.replace("%online%", String.valueOf(L2World.getInstance().getAllPlayersCount())); No error , but doesnt work ! when i open html of npc i see %online% no how much player are online... npc is L2Npc category.
0 Sawadee Posted December 1, 2014 Posted December 1, 2014 why u want Online Players npc when u have alt + b or .online command ? or you want Online Players NPC with Their Time Online + how much Farm Coins / Vote Coins they have?
0 Waster Posted December 1, 2014 Author Posted December 1, 2014 why u want Online Players npc when u have alt + b or .online command ? or you want Online Players NPC with Their Time Online + how much Farm Coins / Vote Coins they have? Cause i create a server info npc and i though is good idea on center to have this Online Players: 200 px its nice though
0 Sawadee Posted December 1, 2014 Posted December 1, 2014 Cause i create a server info npc and i though is good idea on center to have this Online Players: 200 px its nice though my opinion its not that good:D maybe i can help u in smth like this
0 Devlin Posted December 1, 2014 Posted December 1, 2014 Doesnt work , i open L2NpcInstance i cant find what you say.. pack L2j frozen I told you L2Npc, not L2NpcInstance. I am using the same code for my NPCs and it works perfect.
0 Devlin Posted December 1, 2014 Posted December 1, 2014 Also I bet that you put it at the wrong method. public void showChatWindow(final L2PcInstance player, final int val) at this method.
0 Waster Posted December 1, 2014 Author Posted December 1, 2014 where the fack is l2npc can you send me where?
0 Devlin Posted December 1, 2014 Posted December 1, 2014 Go at L2NpcInstance Search for this: public void showChatWindow(final L2PcInstance player, final int val) and here put the line I gave you.
0 Waster Posted December 1, 2014 Author Posted December 1, 2014 i cant find it , can you send me exactly with lines + etc?
Question
Waster
Hello i would like to do this.. when i write on npc %online% npc shows online players how can i do that? for example <center><font color="00FF00">Online Players: %online% </font></center> .. if you know what i mean.
Edited by xNemesis17 answers to this question
Recommended Posts