Forum

Results 1 to 3 of 3
  1. #1
    Join Date
    February 2018
    Posts
    3

    [HELP] TS3 PHP API get user unique id and nickname

    Hello, so I'm trying to make a script that is able to do the following.

    User A is connected to my server, User A goes to my website and the website automatically gets the unique id and nickname of User A, without him having to type in anything. So, every user who visits the website, should see his unique id and nickname.

    I don't know if you know the TS-N Ranksystem, but they also managed to know your info if you are connected to the ts3 server but i cant find out how to do that.

    Anyone knows more?

  2. #2
    Join Date
    February 2014
    Posts
    136
    Quote Originally Posted by user010194 View Post
    Hello, so I'm trying to make a script that is able to do the following.

    User A is connected to my server, User A goes to my website and the website automatically gets the unique id and nickname of User A, without him having to type in anything. So, every user who visits the website, should see his unique id and nickname.

    I don't know if you know the TS-N Ranksystem, but they also managed to know your info if you are connected to the ts3 server but i cant find out how to do that.

    Anyone knows more?


    PHP Code:
    <?php require 'TeamSpeak3/TeamSpeak3.php';

    $user 'serveradmin';
    $password 'password';
    $ip_query '127.0.0.1';
    $port 9987;

    try {
    $ts3_VirtualServer TeamSpeak3::factory("serverquery://$user:$password@$ip_query/?server_port=$port&nickname=GetNameByIP");

    foreach (
    $ts3_VirtualServer->clientList() as $cl) {  

                  if (
    $cl->client_type) continue;           
         if (
    $cl->getProperty('connection_client_ip') == $_SERVER['REMOTE_ADDR']) {       
                     
    $result[] = $cl->client_nickname;           
                 
    $uid $cl->client_unique_identifier;        
            }      
      }
    }
    catch (
    Exception $e) {       
     echo 
    "<p class='error'><b>Error " $e->getCode() . ":</b> " $e->getMessage() . "</p>";        die;
    }

    if (
    $result == "" ) {
    exit;
    }

    echo 
    "Welcome " implode(', '$result) . "<br>";
    echo 
    "Your Unique ID: " $uid;

    ?>

  3. #3
    Join Date
    February 2018
    Posts
    3
    Thanks, that worked excellent.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: December 15th, 2014, 12:21 PM
  2. Replies: 1
    Last Post: January 3rd, 2013, 09:48 AM
  3. REQUEST: Forced nickname / nickname prefix
    By Mackatack in forum Permission System
    Replies: 0
    Last Post: August 25th, 2011, 11:21 AM
  4. [solved] fix phonetic nickname for unique ID
    By Skorga in forum General Questions
    Replies: 3
    Last Post: June 30th, 2010, 03:52 PM
  5. Replies: 0
    Last Post: December 22nd, 2009, 11:24 AM

Posting Permissions

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