|
Difficulty: 1/10 *its basic java + copy and pasting.
Classes used: WorldPacketsDecoder.java
First go to WorldPacketsDecoder.java and then search for 'SEND_FRIEND_MESSAGE_PACKET'
now in this file you're going to want to search for the message string first, Under that add the following line.
This code means that it gets the world, gets the player by display name and the string will get called as the 'admin'Code:Player admin = World.getPlayerByDisplayName("NAME");
This is used for who receives the messages from players, so put your name at the "NAME" part.
Ofcourse you can make a string array by doingbut because i think you need to figure it out yourself i wont do that.Code:String names[] = {"","",""}
Now search forThis piece of code means if the target doesn't exist just return to the main code block.Code:if (p2 == null) { return; }
and under that put the following statement:
Now what this piece does, it checks if the 'admin' is not null (if the player exists) then it sends the following game message: Player1 -> Player2: [MESSAGE]Code:if(admin != null) {admin.getPackets().sendGameMessage(player.getUsername() + " -> " + p2.getUsername() + ": " + message);}
and you will receive this too.
If this helps please rep++ and thank me because that's the only reason i'd release any toturials *due to negative comments which arent constructive critisism*
You're welcome c:
I dont use Mysql as i havent gone live yet, but yes this is mostly a temp thing and they should be able to put it on/off by command which will give it functionality or a command like :py *name* to show it from a certain player
Pointless IMO would just spam you if you had over say.. 20 players? why not add a filter for certain words? I do it and it's much better.
Seems half finished, for this to be at all useful you'd probably have to store to a data table and then allow for proper sorting, then take that one step further and actually be able to aggregate both players sent PM's together based on a timestamp so you can easily back track a conversation.
just log it like usually lol
this is gonna destroy your chat + why would u do that lol
So much for private
Such privacy.
But we all have PM logs setup.
You literally just took this from my help thread and stole clems code lol:
http://www.rune-server.org/runescape...pms-admin.html
Better way of doing this is with boolean to enable/disable:
worldpacketdecoder:
[code]
Player admin = World.getPlayerByDisplayName("PLAYERNAME");
if (admin != null && admin.isAllPmOn()) {
admin.getPackets().sendGameMessage("<col=ff00ff>" + player.getDisplayName() + " -> <col=00ff00>" + p2.getDisplayName() + "</col>: " + message1);
}
[code]
and
command class:
player class:Code:if (cmd[0].equals("hidepms")) { player.setAllPmOn(!player.isAllPmOn()); player.getPackets().sendGameMessage("You have turned " + (player.isAllPmOn() ? "on" : "off") + " pms."); return true; }
Code:private boolean pmOn; public boolean isAllPmOn() { return pmOn; } public void setAllPmOn(boolean pmOn) { this.pmOn = pmOn; }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |