Forum

Results 1 to 7 of 7
  1. #1
    Join Date
    May 2019
    Location
    Germany
    Posts
    6

    Some questions about writing TeamSpeak-Plugins (C++)

    Hey there!
    I started learning how to write plugins for TeamSpeak, and have some questions now. They're probably really easy and already answered a few times, but I couldn't find anything. So let's start with my problems/questions:
    [FONT=Impact]



    switch(menuItemID) {
    case MENU_ID_CLIENT_1:
    //The Client should be exlcuded from events above
    break;
    default:
    case MENU_ID_CLIENT_2:
    //here, the client should be included again
    break;
    break;
    }


    So my questions are:
    • How do I include and exclude users from events? Using their UID? But how do I get it?
    • How do I keep the users excluded also on TeamSpeak-Shutdown?
    • How do I create a settings/config window?


    Sorry if the questions are stupid / already answered. Thank you so much for reading (and hopefully answering)
    Last edited by SquabToast; May 20th, 2019 at 03:15 PM. Reason: Better understanding of the actual question

  2. #2
    Join Date
    September 2012
    Posts
    6,076
    You're not adding anything anywhere, nor are you ever changing selectedItemID, which wouldn't really make much sense anyway, because it is a function parameter (at least at the place you seem to have copy pasted the code from) and its value will be gone once the function returns. The selectedItemID is given to your plugin by the client when your menu was clicked, so you can know which user / channel the user used your plugin on.
    The value of firstID is lost when it goes out of scope, which is either when the function exits or when the client unloads your plugin, depending on where you defined it.

    As for creating a window, that can be done using Qt for example.
    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
    May 2019
    Location
    Germany
    Posts
    6
    Hey, thank you so much for the quick response, Chris . However, I think you got my question wrong. I updated it now. That's above is not my actual code and I have to admit: The way the question was before was wrong. I hope, you can help me now (better).

    Thanks for the help,
    SquabToast

  4. #4
    Join Date
    September 2012
    Posts
    6,076
    If you want to exclude one specific client, then you could check for the unique Id yes (available with getClientVariableAsString), otherwise find a more generic match that matches every client you want to exclude.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  5. #5
    Join Date
    May 2019
    Location
    Germany
    Posts
    6
    Thank you for answering!
    Well, I indeed want to exclude multiple users. However, it's no big deal. If anyone has a good idea, he can send it (and I'd be glad), but don't waste your time with this question (if I find a solution, I'll post it here).
    I had the idea to save it in an external file, but since including <iostream> ends up in 2609 errors, that won't work. Is there another option to save multiple UIDs and load them somewhere else?

    Thanks for the help,
    SquabToast

  6. #6
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    140
    Have you tried using stdio.h for your file operations?
    Also, if you want to save a little more information you could try using sqlite3, which is already included in windows 10. I toyed around with it a bit, couldnt get it working.

    Also, if you want a complete clusterfuck, you could try C++/CLI. My plugins are made in C++/CLI and it allows C# code and C++ code to exist in the same program, work together and even allow C++ to call C# classes and methods.
    Then you could use the .NET file or databse interfaces.

  7. #7
    Join Date
    May 2019
    Location
    Germany
    Posts
    6
    Thank you Jhhhj_original for the awesome help!
    Using stdio.h appears to work. I can print the UID to the console (and it's correct), but how can I ask if it's the right? Some examples I tried:
    if ("%s", EventActivaterUID == "%s", ExcludedUID)
    --- or ---
    if ("%s"== "%s", ExcludedUID, EventActivaterUID)
    --- or ---
    if (("%s", EventActivaterUID")== ("%s", ExcludedUID))
    --- or ---
    strcpy(EventActivaterUID, 'a');
    ExcludedUID = 'b';
    if ('a' == 'b')


    So, how should compare them? Either it crashes TSł or will be "true" or "false" always.
    EDIT (Hopefully the solution)
    result = strcmp(EventActivaterUID, ExcludedUID);
    if (result == 0) {
    ---
    Thanks for the help,
    SquabToast
    Last edited by SquabToast; May 26th, 2019 at 08:57 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: March 16th, 2017, 05:38 PM
  2. Teamspeak can't open file for writing.
    By FAGGATR0N in forum Windows
    Replies: 2
    Last Post: November 30th, 2014, 04:02 PM
  3. New to TeamSpeak plugins, looking for MULTIPLE plugins :)!
    By Mycelus in forum Client Plugins / Lua Scripts
    Replies: 3
    Last Post: February 5th, 2014, 07:01 PM
  4. Plugins LUA Questions.
    By Goluch in forum Tools / Web Based
    Replies: 1
    Last Post: May 30th, 2010, 05:37 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •