Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 5 of 5
  1. #1
    Join Date
    November 2017
    Posts
    13

    Message Event | plugin sdk

    Hey,
    I have the following code from the example plugin (plugin sdk).

    Code:
    int ts3plugin_onTextMessageEvent(uint64 serverConnectionHandlerID, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored) {
        printf("PLUGIN: onTextMessageEvent %llu %d %d %s %s %d\n", (long long unsigned int)serverConnectionHandlerID, targetMode, fromID, fromName, message, ffIgnored);
    
    	/* Friend/Foe manager has ignored the message, so ignore here as well. */
    	if(ffIgnored) {
    		return 0; /* Client will ignore the message anyways, so return value here doesn't matter */
    	}
    
    #if 0
    	{
    		/* Example code: Autoreply to sender */
    		/* Disabled because quite annoying, but should give you some ideas what is possible here */
    		/* Careful, when two clients use this, they will get banned quickly... */
    		anyID myID;
    		if(ts3Functions.getClientID(serverConnectionHandlerID, &myID) != ERROR_ok) {
    			ts3Functions.logMessage("Error querying own client id", LogLevel_ERROR, "Plugin", serverConnectionHandlerID);
    			return 0;
    		}
    		if(fromID != myID) {  /* Don't reply when source is own client */
    			if(ts3Functions.requestSendPrivateTextMsg(serverConnectionHandlerID, "Text message back!", fromID, NULL) != ERROR_ok) {
    				ts3Functions.logMessage("Error requesting send text message", LogLevel_ERROR, "Plugin", serverConnectionHandlerID);
    			}
    		}
    	}
    #endif
    
        return 0;  /* 0 = handle normally, 1 = client will ignore the text message */
    }
    But what I want is to know, how I can activate this code.
    One line: "disabled, beacause quite annoying".
    So how I can enable it?


    Polenstoffdioxid

  2. #2
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    I'm not sure if I understand your question right.


    If your algorithm is correct, only other clients can trigger this.

    Check if your plugin is enabled. If not, check if you export all required functions (and check the client log for specifics).
    See also this thread which gives a good overview about the used callbacks.

  3. #3
    Join Date
    November 2017
    Posts
    13
    Sorry, my bad.
    Another question.
    The event is also triggered, if someone writes a channel text message.
    How I can get, if it's a private text message?

  4. #4
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    You can get that info from the targetMode argument.

  5. #5
    Join Date
    November 2017
    Posts
    13
    Thank you!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Mass Message Plugin?
    By Pryonic in forum Client Plugins / Lua Scripts
    Replies: 7
    Last Post: March 11th, 2017, 05:28 PM
  2. [request TeamSpeak Plugin for Message's
    By Swat842 in forum Client Plugins / Lua Scripts
    Replies: 0
    Last Post: January 7th, 2016, 10:45 PM
  3. [Help/Request] Plugin that sends a message to specified server group.
    By Tylerjet in forum Client Plugins / Lua Scripts
    Replies: 8
    Last Post: February 28th, 2014, 07:33 AM
  4. Plugin SDK: onEditRecordedVoiceDataEvent event is never raised.
    By NouberNou in forum Bug Reports [EN/DE]
    Replies: 1
    Last Post: April 16th, 2012, 01:22 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
  •