Dalexhd

channelprotection.php

Oct 25th, 2017
395
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.98 KB | None | 0 0
  1. <?php
  2. include_once 'include/config.php';
  3. include_once 'include/ts3admin.class.php';
  4.  
  5. function channelprotection()
  6. {
  7.     global $config;
  8.     global $query;
  9.     $clients = $query->getElement('data', $query->clientList('-groups'));
  10.     foreach($clients as $client)
  11.     {
  12.         $channel = $query->getElement('data', $query->channelInfo($client['cid']));
  13.         $check = strpos($channel['channel_topic'], "protect=");
  14.         if ($check !== false)
  15.         {
  16.             $rozdzielenie = explode("=", $channel['channel_topic']);
  17.             $idgrupy = array($rozdzielenie[1]);
  18.  
  19.             $groups = explode(",", $client['client_servergroups']);
  20.             if(!isInGroup($groups, $idgrupy) && !isInGroup($groups, $config['channelprotection']['admingroup']))
  21.             {
  22.                 $query->clientKick($client['clid'], "channel", "Nie masz uprawnień by przebywać na tym kanale!");
  23.                 $query->sendMessage(1, $client['clid'], '[COLOR=#990000][B]Nie masz uprawnień by przebywać na tym kanale![/B][/COLOR]');
  24.             }
  25.         }
  26.     }
  27.  
  28.     unset($query);
  29.     unset($config);
  30. }
  31.  
  32. ?>
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment