Guest User

Untitled

a guest
Aug 22nd, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 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. require_once("ts3admin.class.php");
  12. $tsAdmin = new ts3admin($teamspeakInfo['host'], $teamspeakInfo['portQuery']);
  13.  
  14. if($tsAdmin->getElement('success', $tsAdmin->connect())) {
  15. echo "> Successfully connected to the teamspeak server\n";
  16. $tsAdmin->login($teamspeakInfo['username'], $teamspeakInfo['password']);
  17. echo "> Successfully logged in\n";
  18. $tsAdmin->selectServer($teamspeakInfo['portServer']);
  19. echo "> Successfully selected server ".$teamspeakInfo['portServer']."\n";
  20. $tsAdmin->setName($teamspeakInfo['displayname']);
  21. echo "> Successfully changed name to ".$teamspeakInfo['displayname']."\n";
  22.  
  23. $connectionInfo = $tsAdmin->whoAmI()['data'];
  24.  
  25. for(;;){
  26. $clients = $tsAdmin->clientList("-country -ip");
  27.  
  28. foreach($clients['data'] as $client) {
  29. if($client['client_country'] == "DE")
  30. {
  31. $client->addservergroup(1); //Servergroup for German Country
  32. }
  33. if($client['client_country'] == "UK")
  34. {
  35. $client->addservergroup(1); //Servergroup for the UK Country
  36. }
  37. }
  38. }
  39.  
  40. ?>
Add Comment
Please, Sign In to add comment