Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- // Teamspeak config
- $teamspeakInfo = array(
- 'username' => 'serveradmin',
- 'password' => 'your password',
- 'host' => '127.0.0.1',
- 'portQuery' => '10011',
- 'portServer' => '9987',
- 'displayname' => 'COUNTRY' // Display of the Bot
- );
- $groupsetup = array(
- "DE" => 10,
- "UK" => 11
- );
- require_once("ts3admin.class.php");
- $tsAdmin = new ts3admin($teamspeakInfo['host'], $teamspeakInfo['portQuery']);
- if($tsAdmin->getElement('success', $tsAdmin->connect())) {
- echo "> Successfully connected to the teamspeak server\n";
- $tsAdmin->login($teamspeakInfo['username'], $teamspeakInfo['password']);
- echo "> Successfully logged in\n";
- $tsAdmin->selectServer($teamspeakInfo['portServer']);
- echo "> Successfully selected server ".$teamspeakInfo['portServer']."\n";
- $tsAdmin->setName($teamspeakInfo['displayname']);
- echo "> Successfully changed name to ".$teamspeakInfo['displayname']."\n";
- $clients = $tsAdmin->clientList("-country");
- foreach($clients['data'] as $client) {
- if (array_key_exists($client["client_country"], $groupsetup)) {
- echo "> Adding Client ".$client["client_database_id"]." to ServerGroup ".$groupsetup[$client["client_country"]];
- $tsAdmin->serverGroupAddClient($groupsetup[$client["client_country"]], $client["client_database_id"]);
- };
- };
- };
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement