Resource icon

Simple & Clean Channel Creator. [Web] 2017-06-26

No permission to download

Mr_omar

Active Member
Jan 5, 2017
83
33
68
Can some one help me with spam system and a system to create only one channel for one user?
Because If you change the teamspeak username, you can create one more channel.. .:(
You can modify to addservergroup for who create a channel after that you have to make the page if someone has this servergroup he can't use the script ;)
 

DeadSecret

Member
Sep 25, 2015
15
0
36
You can modify to addservergroup for who create a channel after that you have to make the page if someone has this servergroup he can't use the script ;)

The function "addservergroup" does not exist..

#Edit
I found it. But I dont know how I can check the servergroup! :)
But my next problem is, i get no confirmed message after submit button click.
 
Last edited:

DeadSecret

Member
Sep 25, 2015
15
0
36
You can use both, no problem just add ts3admin.class.php to your files

Okay, I have it like this:
Code:
foreach($servergroups as $servergroup)
        {
            if($servergroup == $server_group) // $server_group = 12
            {
                if($servergroup != $server_group_create) // $server_group_create = 14
                {
                    $isMember = true;
                }
            }
        }
The check of servergroup 12 works, but it should also check if 14 already exists, if yes, he should not create a channel, can you help me? (Sorry for english^^)
And if 12 is present and 14 is not available, it should create a channel
 

Mr_omar

Active Member
Jan 5, 2017
83
33
68
Okay, I have it like this:
Code:
foreach($servergroups as $servergroup)
        {
            if($servergroup == $server_group) // $server_group = 12
            {
                if($servergroup != $server_group_create) // $server_group_create = 14
                {
                    $isMember = true;
                }
            }
        }
The check of servergroup 12 works, but it should also check if 14 already exists, if yes, he should not create a channel, can you help me? (Sorry for english^^)
And if 12 is present and 14 is not available, it should create a channel
You can use this:
PHP:
foreach(explode(",", $ts3_VirutalServer["client_servergroups"]) as $sgid)
                                                {
                                                $groups[] = $ts3_VirtualServer->serverGroupGetById($sgid);
                                                }
if (in_array("PrivateRoom",$groups)){
Die("you already have a room");
}
// PrivateRoom = the name of
servergroup that have bean create channel
 

DeadSecret

Member
Sep 25, 2015
15
0
36
You can use this:
PHP:
foreach(explode(",", $ts3_VirutalServer["client_servergroups"]) as $sgid)
                                                {
                                                $groups[] = $ts3_VirtualServer->serverGroupGetById($sgid);
                                                }
if (in_array("PrivateRoom",$groups)){
Die("you already have a room");
}
// PrivateRoom = the name of
servergroup that have bean create channel

How do you mean it? I dont understand you right now..
My Script:
Code:
foreach($clients['data'] as $client)
    {
        if($client['connection_client_ip'] == getClientIp())
        {
            $username = $client['client_nickname'];
        $servergroups = explode(",", $client['client_servergroups']);
    }
  }
  $isMember = false;
    if(empty($username))
    {
        echo "You are not connected!<br />";
    }
    else
    {
        foreach($servergroups as $servergroup)
        {
            if($servergroup == $server_group) // 12
            {
                if($servergroup != $server_group_create) // 14
                {
                    $isMember = true;
                }
            }
        }
    }
    if(!empty($username))
    {
        if ($isMember)
        ..... CHANNEL CREATION BEGINS ....
        {
 

Mr_omar

Active Member
Jan 5, 2017
83
33
68
How do you mean it? I dont understand you right now..
My Script:
Code:
foreach($clients['data'] as $client)
    {
        if($client['connection_client_ip'] == getClientIp())
        {
            $username = $client['client_nickname'];
        $servergroups = explode(",", $client['client_servergroups']);
    }
  }
  $isMember = false;
    if(empty($username))
    {
        echo "You are not connected!<br />";
    }
    else
    {
        foreach($servergroups as $servergroup)
        {
            if($servergroup == $server_group) // 12
            {
                if($servergroup != $server_group_create) // 14
                {
                    $isMember = true;
                }
            }
        }
    }
    if(!empty($username))
    {
        if ($isMember)
        ..... CHANNEL CREATION BEGINS ....
        {
Just use it like this :
PHP:
<?php
require('ts3admin.class.php');

//###################  Config  #####################

$cfg['tsIP'] = "127.0.0.1";
$cfg['tsQueryport'] = "10011";
$cfg['tsPort'] = "9987";
$cfg['tsLogin'] = "serveradmin";
$cfg['tsPassword'] = "pass";
$cfg['tsName'] = "R4P3 Bot";

//##################################################

function getIP()
{
    foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key)
    {
        if (array_key_exists($key, $_SERVER) === true)
        {
            foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip)
            {
                if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false)
                {
                    return $ip;
                }
            }
        }
    }
}

$tsAdmin = new ts3admin($cfg['tsIP'], $cfg['tsQueryport']);
if($tsAdmin->getElement('success', $tsAdmin->connect())) {
    $tsAdmin->login($cfg['tsLogin'], $cfg['tsPassword']);
    $tsAdmin->selectServer($cfg['tsPort']);
    $tsAdmin->setName($cfg['tsName']);
 
    $clients = $tsAdmin->clientList("-ip -groups");

        foreach($clients['data'] as $client) {
            if($client['connection_client_ip'] == getIP()) {
                $username = $client['client_nickname'];
                $servergroups = explode(",", $client['client_servergroups']);
            }
        }
        $isMember = false;
        if(empty($username)) {
            echo "Please join our Teamspeak<br />";
        } else {
            foreach($servergroups as $servergroup){
                if($servergroup == 14){ //The 14 is the servergroup that have bean create one
                    $isMember = true;
                }
            }
        }
   
        if(!empty($username)){
            if ($isMember) {
                Die("You Already have channel");
            } else {
             // you don't have to do anything here  
            }
        }
}
?>
   ..... CHANNEL CREATION BEGINS ....
 

DeadSecret

Member
Sep 25, 2015
15
0
36
Just use it like this :
PHP:
<?php
require('ts3admin.class.php');

//###################  Config  #####################

$cfg['tsIP'] = "127.0.0.1";
$cfg['tsQueryport'] = "10011";
$cfg['tsPort'] = "9987";
$cfg['tsLogin'] = "serveradmin";
$cfg['tsPassword'] = "pass";
$cfg['tsName'] = "R4P3 Bot";

//##################################################

function getIP()
{
    foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key)
    {
        if (array_key_exists($key, $_SERVER) === true)
        {
            foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip)
            {
                if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false)
                {
                    return $ip;
                }
            }
        }
    }
}

$tsAdmin = new ts3admin($cfg['tsIP'], $cfg['tsQueryport']);
if($tsAdmin->getElement('success', $tsAdmin->connect())) {
    $tsAdmin->login($cfg['tsLogin'], $cfg['tsPassword']);
    $tsAdmin->selectServer($cfg['tsPort']);
    $tsAdmin->setName($cfg['tsName']);
 
    $clients = $tsAdmin->clientList("-ip -groups");

        foreach($clients['data'] as $client) {
            if($client['connection_client_ip'] == getIP()) {
                $username = $client['client_nickname'];
                $servergroups = explode(",", $client['client_servergroups']);
            }
        }
        $isMember = false;
        if(empty($username)) {
            echo "Please join our Teamspeak<br />";
        } else {
            foreach($servergroups as $servergroup){
                if($servergroup == 14){ //The 14 is the servergroup that have bean create one
                    $isMember = true;
                }
            }
        }
 
        if(!empty($username)){
            if ($isMember) {
                Die("You Already have channel");
            } else {
             // you don't have to do anything here
            }
        }
}
?>
   ..... CHANNEL CREATION BEGINS ....

Yeah I know, but he should check the user if he in servergroup 12 and servergroup 14, if the user in 12 and 14, the server should not create a new channel and is the user only in servergroup 12 and not in 14 he should create a channel and is the user not in servergroup 12 and 14, he should not create a channel, you understand me ?

#EDIT - I fixed it by my self, thanks alot btw :)
 
Last edited:

DeadSecret

Member
Sep 25, 2015
15
0
36
Hi, I'm again.
I have the next problem. I want to makea automatic delete function of an unused channel, but I dont know how. Can someone help me ?
 

DeadSecret

Member
Sep 25, 2015
15
0
36
Code:
InactiveChannelCheck_emptydeletetime = 1 (1 Hour, I know)
InactiveChannelCheck_ignore_permanent = no
InactiveChannelCheck_ignore_semipermanent = no
InactiveChannelCheck_ignore_spacer = no
InactiveChannelCheck_ignore_channels =

Is that right for the config?
 

Mr_omar

Active Member
Jan 5, 2017
83
33
68
Code:
InactiveChannelCheck_emptydeletetime = 1 (1 Hour, I know)
InactiveChannelCheck_ignore_permanent = no
InactiveChannelCheck_ignore_semipermanent = no
InactiveChannelCheck_ignore_spacer = no
InactiveChannelCheck_ignore_channels =

Is that right for the config?
Yup :D
 

DeadSecret

Member
Sep 25, 2015
15
0
36
You are welcome :)

Okay.. He shows me the error: "Unable to activate function "InactiveChannelCheck", unknown name!"

My Config:

Code:
bot_functions = InactiveChannelCheck

InactiveChannelCheck_emptydeletetime = 1
InactiveChannelCheck_ignore_permanent = no
InactiveChannelCheck_ignore_semipermanent = no
InactiveChannelCheck_ignore_spacer = no
InactiveChannelCheck_ignore_channels =

Whats wrong? <.<
 

Mr_omar

Active Member
Jan 5, 2017
83
33
68
Okay.. He shows me the error: "Unable to activate function "InactiveChannelCheck", unknown name!"

My Config:

Code:
bot_functions = InactiveChannelCheck

InactiveChannelCheck_emptydeletetime = 1
InactiveChannelCheck_ignore_permanent = no
InactiveChannelCheck_ignore_semipermanent = no
InactiveChannelCheck_ignore_spacer = no
InactiveChannelCheck_ignore_channels =

Whats wrong? <.<
Did you use the full script ? Or just copy those lines?
 

DeadSecret

Member
Sep 25, 2015
15
0
36
Did you use the full script ? Or just copy those lines?

wo5mdDz.png
 
Top