Dalexhd

nickprotect.php

Oct 25th, 2017
401
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?php
  2. include_once 'include/config.php';
  3. include_once 'include/ts3admin.class.php';
  4.  
  5. function nickprotect()
  6. {
  7.     global $query;
  8.     global $config;
  9.  
  10.     $list = $query->getElement('data', $query->clientList());
  11.     foreach((array) $list as $clients)
  12.     {
  13.         for($i = 0; $i<count($config['nickprotect']['protected']); $i++)
  14.         {
  15.             if (strpos($clients['client_nickname'], $config['nickprotect']['protected'][$i]) !== false)
  16.             {
  17.                 $msg = file_get_contents($config['host_message']['msgpath'], "r");
  18.                 $msg = str_replace('[word]', $config['nickprotect']['protected'][$i], $msg);
  19.                 $query->clientKick($clients['clid'], 'server', $msg);
  20.             }
  21.         }
  22.     }
  23. }
  24. ?>
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment