Thread: See the pm's players send to eachother.

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 See the pm's players send to eachother. 
    Registered Member
    Join Date
    Jul 2015
    Posts
    85
    Thanks given
    9
    Thanks received
    1
    Rep Power
    24
    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.
    Code:
    Player admin = World.getPlayerByDisplayName("NAME");
    This code means that it gets the world, gets the player by display name and the string will get called as the 'admin'
    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 doing
    Code:
    String names[] = {"","",""}
    but because i think you need to figure it out yourself i wont do that.
    Now search for
    Code:
    if (p2 == null) { return; }
    This piece of code means if the target doesn't exist just return to the main code block.
    and under that put the following statement:
    Code:
    if(admin != null) {admin.getPackets().sendGameMessage(player.getUsername() + " -> " + p2.getUsername() + ": " + message);}
    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]
    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:

    Reply With Quote  
     

  2. #2  
    Member See the pm's players send to eachother. Market Banned
    Mr Joopz's Avatar
    Join Date
    Aug 2012
    Age
    26
    Posts
    1,410
    Thanks given
    259
    Thanks received
    96
    Rep Power
    14
    Quote Originally Posted by lucasouwens View Post
    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.
    Code:
    Player admin = World.getPlayerByDisplayName("NAME");
    This code means that it gets the world, gets the player by display name and the string will get called as the 'admin'
    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 doing
    Code:
    String names[] = {"","",""}
    but because i think you need to figure it out yourself i wont do that.
    Now search for
    Code:
    if (p2 == null) { return; }
    This piece of code means if the target doesn't exist just return to the main code block.
    and under that put the following statement:
    Code:
    if(admin != null) {admin.getPackets().sendGameMessage(player.getUsername() + " -> " + p2.getUsername() + ": " + message);}
    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]
    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:

    Cool feature, but if i did that on my server i think i would probably crash lmfao and never see anything, it's much better being saved into your data files for future use too, or if you're handle with mysql, upload it to your site.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2015
    Posts
    85
    Thanks given
    9
    Thanks received
    1
    Rep Power
    24
    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
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Mar 2010
    Posts
    2,218
    Thanks given
    170
    Thanks received
    262
    Rep Power
    0
    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.
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Dec 2011
    Posts
    1,615
    Thanks given
    1,971
    Thanks received
    819
    Rep Power
    1049
    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.
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Jul 2011
    Posts
    1,767
    Thanks given
    493
    Thanks received
    425
    Rep Power
    0
    just log it like usually lol

    this is gonna destroy your chat + why would u do that lol
    Reply With Quote  
     

  7. #7  
    Registered Member ArrowNox's Avatar
    Join Date
    May 2015
    Posts
    46
    Thanks given
    36
    Thanks received
    18
    Rep Power
    0
    So much for private
    See yah RSPS, it was fun!
    Reply With Quote  
     

  8. Thankful user:


  9. #8  
    Registered Member Blackmoon's Avatar
    Join Date
    Jun 2014
    Posts
    633
    Thanks given
    47
    Thanks received
    107
    Rep Power
    42
    Such privacy.

    But we all have PM logs setup.

    Reply With Quote  
     

  10. #9  
    Registered Member
    Join Date
    Jul 2015
    Posts
    85
    Thanks given
    9
    Thanks received
    1
    Rep Power
    24
    Quote Originally Posted by Tristam View Post
    just log it like usually lol

    this is gonna destroy your chat + why would u do that lol
    the toturial isn't finished yet as i am planning to make a command (:py *name*) and certain words will also auto enable it, but i was experimenting and found this so i decided to share it ^,^
    Reply With Quote  
     

  11. #10  
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    Quote Originally Posted by lucasouwens View Post
    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.
    Code:
    Player admin = World.getPlayerByDisplayName("NAME");
    This code means that it gets the world, gets the player by display name and the string will get called as the 'admin'
    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 doing
    Code:
    String names[] = {"","",""}
    but because i think you need to figure it out yourself i wont do that.
    Now search for
    Code:
    if (p2 == null) { return; }
    This piece of code means if the target doesn't exist just return to the main code block.
    and under that put the following statement:
    Code:
    if(admin != null) {admin.getPackets().sendGameMessage(player.getUsername() + " -> " + p2.getUsername() + ": " + message);}
    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]
    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:

    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:
    Code:
    			if (cmd[0].equals("hidepms")) {
    				player.setAllPmOn(!player.isAllPmOn());
    				player.getPackets().sendGameMessage("You have turned " + (player.isAllPmOn() ? "on" : "off") + " pms.");
    				return true;
    			}
    player class:

    Code:
    	private boolean pmOn;
    
    	public boolean isAllPmOn() {
    		return pmOn;
    	}
    
    	public void setAllPmOn(boolean pmOn) {
    		this.pmOn = pmOn;
    	}
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 31
    Last Post: 11-12-2015, 05:26 PM
  2. Replies: 2
    Last Post: 11-15-2013, 03:56 PM
  3. Replies: 6
    Last Post: 12-19-2011, 03:28 AM
  4. If I wanted to see the Top 5 servers...
    By Vegeta in forum Complaints
    Replies: 10
    Last Post: 08-21-2010, 03:55 PM
  5. I can only see the Forums to Red Carpet.
    By Xero in forum Complaints
    Replies: 9
    Last Post: 07-21-2009, 11:08 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •