Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Created by Klitek
- $ts3_ip = '127.0.0.1';
- $ts3_queryport = 10011;
- $ts3_port = 9987;
- $ts3_user = 'serveradmin';
- $ts3_pass = 'ivoviix00';
- require("ts3admin.class.php");
- require("config.php");
- $ts3 = new ts3admin($ts3_ip, $ts3_queryport);
- if($ts3 -> getElement('success', $ts3 -> connect())) {
- $ts3 -> selectServer($ts3_port);
- $ts3 -> login($ts3_user, $ts3_pass);
- $clientsID = array();
- $channelEdit = array();
- $data = array();
- $konwerter = array();
- $clientInfo = array();
- $lock = array();
- while(true == true){
- sleep($sleepTime);
- for($i = 0; $i < count($clients); ++$i){
- //Zdobywanie ID z grup
- $clientsID[$i] = $ts3 -> clientGetNameFromDbid($clients[$i]);
- //Pobieranie ID
- $konwerter[$i] = $ts3 -> clientGetIds($clientsID[$i]['data']['cluid']); //Malo wazne
- $IDs[$i] = $konwerter[$i]['data'][0]['clid'];
- //Pobieranie informacji o uzytkowniku
- $clientInfo[$i] = $ts3 -> clientInfo($IDs[$i]);
- //Info o kanale
- $channelInfo[$i] = $ts3 -> channelInfo($channels[$i]);
- //Info o grupach ! $groupList['data'][id]['name'] !
- //$groupList = $ts3 -> serverGroupList();
- if($clientInfo[$i]['data']['connection_bandwidth_sent_last_second_total'] == 0) {
- //Nazwa kanalu == nick
- $data['channel_name'] = '[OFF] '.$clientsID[$i]['data']['name'];
- $channelEdit[$i] = $ts3 -> channelEdit($channels[$i], $data);
- if($unlock == true){
- if($channelInfo[$i]['data']['channel_maxclients'] == 666){
- $lock['channel_maxclients'] = 0;
- $channelEdit[$i] = $ts3 -> channelEdit($channels[$i], $lock);
- }
- }
- }elseif($clientInfo[$i]['data']['client_away'] == 1)
- {
- $data['channel_name'] = '[AFK] '.$clientsID[$i]['data']['name'];
- $channelEdit[$i] = $ts3 -> channelEdit($channels[$i], $data);
- if($channelInfo[$i]['data']['channel_maxclients'] == 666){
- $lock['channel_maxclients'] = 0;
- $channelEdit[$i] = $ts3 -> channelEdit($channels[$i], $lock);
- }
- }elseif($clientInfo[$i]['data']['client_away'] == 0){
- $data['channel_name'] = '[ON] '.$clientsID[$i]['data']['name'];
- $channelEdit[$i] = $ts3 -> channelEdit($channels[$i], $data);
- if($unlock == true){
- if($channelInfo[$i]['data']['channel_maxclients'] == 0){
- $lock['channel_maxclients'] = 666;
- $channelEdit[$i] = $ts3 -> channelEdit($channels[$i], $lock);
- }
- }
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement