Advertisement
Multivit4min

Untitled

Aug 22nd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.37 KB | None | 0 0
  1. <?PHP
  2.     // Teamspeak config
  3.     $teamspeakInfo = array(
  4.         'username' => 'serveradmin',
  5.         'password' => 'your password',
  6.         'host' => '127.0.0.1',
  7.         'portQuery' => '10011',
  8.         'portServer' => '9987',
  9.         'displayname' => 'COUNTRY' // Display of the Bot
  10.     );
  11.  
  12.     $groupsetup = array(
  13.         "DE" => 10,
  14.         "UK" => 11
  15.     );
  16.  
  17.     require_once("ts3admin.class.php");
  18.     $tsAdmin = new ts3admin($teamspeakInfo['host'], $teamspeakInfo['portQuery']);
  19.      
  20.     if($tsAdmin->getElement('success', $tsAdmin->connect())) {
  21.         echo "> Successfully connected to the teamspeak server\n";
  22.         $tsAdmin->login($teamspeakInfo['username'], $teamspeakInfo['password']);
  23.         echo "> Successfully logged in\n";
  24.         $tsAdmin->selectServer($teamspeakInfo['portServer']);
  25.         echo "> Successfully selected server ".$teamspeakInfo['portServer']."\n";
  26.         $tsAdmin->setName($teamspeakInfo['displayname']);
  27.         echo "> Successfully changed name to ".$teamspeakInfo['displayname']."\n";
  28.  
  29.         $clients = $tsAdmin->clientList("-country -ip");
  30.  
  31.         foreach($clients['data'] as $client) {
  32.             if (array_key_exists($client["client_country"], $groupsetup)) {
  33.                 $tsAdmin->serverGroupAddClient($client["client_database_id"], $groupsetup[$client["client_country"]]);
  34.             };
  35.         };
  36.     };
  37.  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement