Results 1 to 6 of 6
  1. #1
    CrazyJani's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    2,475
    Reputation
    170
    Thanks
    15,666

    [Realm Relay] How to display message in client?

    I want to display a message in the chat of the client, how to do that?

  2. #2
    FainTMako's Avatar
    Join Date
    Nov 2013
    Gender
    male
    Posts
    332
    Reputation
    10
    Thanks
    244
    My Mood
    Inspired
    Use onpacket it will help you learn packets. Its in the sources section

  3. #3
    CrazyJani's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    2,475
    Reputation
    170
    Thanks
    15,666
    I thought it just gets the IDs of the packets

  4. #4
    FainTMako's Avatar
    Join Date
    Nov 2013
    Gender
    male
    Posts
    332
    Reputation
    10
    Thanks
    244
    My Mood
    Inspired
    It does things when packets come in or out and tells you what packet

    You look like you want to be spoon fed there is lots of rr stuff in tutorials section put some of your own time into it.

  5. #5
    CrazyJani's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    2,475
    Reputation
    170
    Thanks
    15,666
    Quote Originally Posted by FainTMako View Post
    It does things when packets come in or out and tells you what packet

    You look like you want to be spoon fed there is lots of rr stuff in tutorials section put some of your own time into it.
    Sorry, I'll try harder myself next time

  6. #6
    The richest man is not the one who has the most but the one who needs the least.
    MPGH Member
    Alde.'s Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    1,706
    Reputation
    166
    Thanks
    3,627
    My Mood
    Sleepy
    Display a msg above the head
    Code:
    function displayNotification(event, playerObjectId, color, text) {
    	var notificationPacket = event.createPacket(ID_NOTIFICATION);
    	notificationPacket.objectId = playerObjectId;
    	notificationPacket.message = "{\"key\":\"blank\",\"tokens\":{\"data\":\"" + text + "\"}}";
    	notificationPacke*****lor = color;
    	event.sendToClient(notificationPacket);
    }

    Yellow text
    Code:
    function serveralert(event, playerObjectId, color, text) {
    	var textPacket = event.createPacket(ID_TEXT);
    	textPacket.name = "WC"; //ornge txt
    	textPacket.objectId = -1;
    	textPacket.numStars = 70;
    	textPacket.bubbleTime = 0;//The time the bubble stays
    	textPacket.recipient = "";
    	textPacket.text = text;
    	textPacket.cleanText = "";
    	event.sendToClient(textPacket);
    }

    Red text (error)
    Code:
    function failurealert(event,text){ //This is used to draw the "# has left"
    	var failurePacket = event.createPacket(ID_FAILURE);
    	failurePacket.errorId = 99;
    	failurePacket.errorDescription = text;
    	event.sendToClient(failurePacket);
    }
    Last edited by Alde.; 01-25-2014 at 12:45 PM.
    Alde is Alde is

  7. The Following 2 Users Say Thank You to Alde. For This Useful Post:

    BRDominik (10-11-2014),CrazyJani (02-03-2014)

Similar Threads

  1. Realm Relay autoloot
    By Nisuxen in forum Realm of the Mad God Tutorials & Source Code
    Replies: 72
    Last Post: 01-03-2018, 02:26 PM
  2. [Tutorial] RealmRelay - Basics and Scripting
    By Alde. in forum Realm of the Mad God Tutorials & Source Code
    Replies: 26
    Last Post: 03-20-2017, 09:50 PM
  3. [Realm Relay] Potion Seller
    By prechcik in forum Realm of the Mad God Tutorials & Source Code
    Replies: 33
    Last Post: 09-07-2014, 06:24 PM
  4. [Realm Relay] Can't connect to USWest!
    By prechcik in forum Realm of the Mad God Help & Requests
    Replies: 1
    Last Post: 01-22-2014, 08:36 AM
  5. [Realm Relay] Item select on trade
    By prechcik in forum Realm of the Mad God Help & Requests
    Replies: 16
    Last Post: 01-22-2014, 07:47 AM