If we just change the handler we can make it for any npc we want hmm?
|
|
If we just change the handler we can make it for any npc we want hmm?
Nice But Tho, Cant You Use Switches?
Could Work. And Neater CodeCode:import java.io.*; public class NPCKillHandler { public void npcID(int npcIdd, int playerId) { client p = (client) server.playerHandler.players[playerId]; switch (npcIdd){ case 2060: p.npckName = "Slash Bash"; break; case 1615: p.npckName = "Abyssal Demon"; break; default: break; } } public void npcKilled(int playerId, int npcId) { client p = (client) server.playerHandler.players[playerId]; npcID(npcId, playerId); if(NpcID != -1) { PlayerHandler.messageToAll = p.npckName+" has been slain by "+p.playerName+"(Lvl "+p.combat+")."; } } public void npcKilledd(int npcId) { npcKilled(playerIdd, npcId); } public int playerIdd = 0; public int NpcID = 0; }![]()
Works Fine For Me ^_^
Yes, you could use swithes. This is just a simple version for all those noobs, its only capable of doing NPCs messages for NPCs you include in the handler, and you can improve this by a lot if you're not a noob. ^_^ Thanks for the comments.
wtf?! this didnt work for me?
no errors on compile, but when i kill an npc, it doesn't give the message.
yes! i did add the npc id's and names to NPCKillHandler.java
I've updated the handler maybe you have the wrong one, re-download it, either that or you added the NPC IDs wrong, because it DOES work.
I realized there was some kind of bug that messed up a little. Just fixed that.
I did all what the tutorial said, i get no error in compiling but umm..It doesent work.
thanks this helps quite a bit i will rep+ you for thinking of something smart to add to servers instead of something like "full drunkness!"
| « Full skillcape specials for new ones!! | Ice Pk Box! » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |