Forum

Results 1 to 4 of 4
  1. #1
    Join Date
    February 2013
    Posts
    8

    Post How to send chat messages to Server Query

    I'm working on a script that displays information to a client if they request it. Firstly I get the server query to send a message to all clients at the start (so that clients can then use this chat window to send messages back). Then I want clients to be able type commands back to the server using the chat box.

    For example, if a user were to type:

    /events or events

    into the chat, I would then want it to return some information on upcoming events (just as an example). Is this possible?


    Jamie


    P.S
    Sorry if this is not the correct section to post this.
    Last edited by JamieG193; June 29th, 2013 at 03:50 PM.

  2. #2
    Join Date
    September 2012
    Posts
    6,076
    It sure is possible, you just cannot use "/" at the beginning in the client since that is reserved for plugin commands.
    In the server query script you would need to subscribe to the private text events with servernotifyregister event=textprivate and you would receive the text message including information who sent it each time someone writes you privately, which you could then parse and act upon accordingly.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  3. #3
    Join Date
    February 2013
    Posts
    8
    Quote Originally Posted by Chris View Post
    It sure is possible, you just cannot use "/" at the beginning in the client since that is reserved for plugin commands.
    In the server query script you would need to subscribe to the private text events with servernotifyregister event=textprivate and you would receive the text message including information who sent it each time someone writes you privately, which you could then parse and act upon accordingly.
    Ah I see, thanks for your reply.

    Would I just send the servernotifyregister event=textprivate command at any time to enable this? Also, how would I then be able to retrieve whatever was sent to the server (from the client)? To illustrate:

    1. Client sends message to server via chat box
    2. Server stores information (or does something with it) once received ( <-- how would I do this? )


    Edit: Nevermind, I managed to find a way to pull the data from the Telnet output.
    Last edited by JamieG193; July 3rd, 2013 at 11:56 PM.

  4. #4
    Join Date
    September 2012
    Posts
    6,076
    Yes you register for the event once and then whenever said event happens it is send to you through the telnet connection, so you could just check if data is available on a regular basis then read and parse them and act accordingly.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [Resolved] Query creates channels, send messages or pokes users
    By dante696 in forum Permission System
    Replies: 233
    Last Post: April 27th, 2019, 05:31 PM
  2. Disable chat messages for Guest Server Query
    By xeroe in forum Permission System
    Replies: 5
    Last Post: February 22nd, 2015, 09:53 AM
  3. send text messages to everyone
    By constrych9 in forum General Questions
    Replies: 5
    Last Post: February 8th, 2011, 06:01 PM
  4. Replies: 0
    Last Post: December 23rd, 2009, 01:54 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
  •