Dalexhd icon

channelprotection.php

Dalexhd | PRO | 10/25/17 08:22:16 AM UTC | 0 ⭐ | 368 👁️ | Never ⏰ | []
PHP |

980 B

|

None

|

0 👍

/

0 👎

<?php
include_once 'include/config.php';
include_once 'include/ts3admin.class.php';
 
function channelprotection()
{
    global $config;
    global $query;
    $clients = $query->getElement('data', $query->clientList('-groups'));
    foreach($clients as $client)
    {
        $channel = $query->getElement('data', $query->channelInfo($client['cid']));
        $check = strpos($channel['channel_topic'], "protect=");
        if ($check !== false)
        {
            $rozdzielenie = explode("=", $channel['channel_topic']);
            $idgrupy = array($rozdzielenie[1]);
 
            $groups = explode(",", $client['client_servergroups']);
            if(!isInGroup($groups, $idgrupy) && !isInGroup($groups, $config['channelprotection']['admingroup']))
            {
                $query->clientKick($client['clid'], "channel", "Nie masz uprawnień by przebywać na tym kanale!");
                $query->sendMessage(1, $client['clid'], '[COLOR=#990000][B]Nie masz uprawnień by przebywać na tym kanale![/B][/COLOR]');
            }
        }
    }
 
    unset($query);
    unset($config);
}
 
?>

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎