Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // how i take client id form nickname and channel id from array
- <?php
- require_once('lib/ts3admin.class.php');
- $tsIp = '127.0.0.1';
- $tsQueryPort = '10011';
- $tsUsername = 'serveradmin';
- $tsPass = 'qtR1I4hl';
- $tsPort = '9987';
- $tsQueryName = 'sexy';
- $tsAdmin = new ts3admin ($tsIp, $tsQueryPort);
- if ($tsAdmin->getElement('success', $tsAdmin->connect())) {
- $tsAdmin->login($tsUsername,$tsPass);
- $tsAdmin->selectServer($tsPort);
- $tsAdmin->setName("$tsQueryName");
- $whoAmI = $tsAdmin->whoAmI();
- echo "Connection established server!\n";
- print_r($tsAdmin->clientInfo(1));
- while (true) {
- $clientList = $tsAdmin->clientList();
- foreach ($clientList['data'] as $clientListTemp) {
- $nickname = $clientListTemp['client_nickname'];
- if ($nickname == '<3') {
- $UserMoveToChannelCreate = $clientListTemp['clid'];
- $id = count($tsAdmin->channelList()['data']);
- $channelCreate = array (
- 'channel_name' => "$id. Nomecanale",
- 'channel_flag_permanent' => 1,
- 'cpid' => '276844'
- );
- $result = $tsAdmin->channelCreate($channelCreate);
- $tsAdmin->clientMove({PUT CLIENT ID HERE}, $result['data']['cpid']);
- }
- }
- sleep(5);
- }
- } else {
- echo 'Connection could not be established.\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement