'serveradmin', 'password' => 'your password', 'host' => '127.0.0.1', 'portQuery' => '10011', 'portServer' => '9987', 'displayname' => 'COUNTRY' // Display of the Bot ); 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"; $connectionInfo = $tsAdmin->whoAmI()['data']; for(;;){ $clients = $tsAdmin->clientList("-country -ip"); foreach($clients['data'] as $client) { if($client['client_country'] == "DE") { $client->addservergroup(1); //Servergroup for German Country } if($client['client_country'] == "UK") { $client->addservergroup(1); //Servergroup for the UK Country } } } ?>