Need Help (PHP)

AndyDE

Member
Apr 26, 2016
36
7
43
Hey im using R4P3_GroupAssigner-master,
now i want this:
Script Check if new User group = Guest Then Poke him with Message
All User they not group Guest, dont get Poke message.
Can Someone help me with Code? ;)

Thanks ;)

sorry for bad english
 

Alligatoras

Administrator
Mar 31, 2016
2,570
12
2,857
381
Hey im using R4P3_GroupAssigner-master,
now i want this:
Script Check if new User group = Guest Then Poke him with Message
All User they not group Guest, dont get Poke message.
Can Someone help me with Code? ;)

Thanks ;)

sorry for bad english
in the admin.php page where you manage it, make sure that in the first tab, you haven't check server groups!
There you choose the server groups that are not allowed to use it!

Maybe i screenshot of the current situaton of your webpage settings will help me see better!
 

AndyDE

Member
Apr 26, 2016
36
7
43
Nah i mean this...
Code:
if (!empty($config['ip']) and !empty($config['queryport']) and !empty($config['serverport']) and !empty($config['loginname']) and !empty($config['qpassword']) and !empty($config['displayname'])) {
     try {
         $ts3 = TeamSpeak3::factory('serverquery://'.rawurlencode($config['loginname']).':'.rawurlencode($config['qpassword']).'@'.rawurlencode($config['ip']).':'.rawurlencode($config['queryport']).'?server_port='.rawurlencode($config['serverport']).'&nickname='.rawurlencode($config['displayname']));
     } catch (TeamSpeak3_Exception $e) {
         exit($e);
     }
     foreach ($ts3->clientList() as $ts3_Client) {
         if ($ts3_Client["client_type"] == 0 and $ts3_Client["connection_client_ip"] == getUserIp()) {
             foreach ($config['groups'] as $group) {                   <<<---------------------- Check if USER a Guest its True then He need to Poke with message its False no Poke 
                 try {
               $ts3_Client->serverGroupClientAdd(intval($group), $ts3_Client->client_database_id);
                 if ($config['send_enable'] == true) {
                       if ($config['send_method'] == 'text') {
                           $ts3_Client->message($config['send_message'].$ts3->serverGroupGetById($group));
                       } else if ($config['send_method'] == 'poke'){
                           $ts3_Client->poke($config['send_message'].$ts3->serverGroupGetById($group));
                   }
                     }
                     log_write($ts3_Client->client_nickname." got assigned to a group (".$ts3->serverGroupGetById($group)." / ".$group.")", "Information");
                   } catch (Exception $e) {}
            }
        }
      }
}

THIS I MEAN ;)
<<<---------------------- Check if USER a Guest its True then He need to Poke with message its False no Poke
 

Alligatoras

Administrator
Mar 31, 2016
2,570
12
2,857
381
Nah i mean this...
Code:
if (!empty($config['ip']) and !empty($config['queryport']) and !empty($config['serverport']) and !empty($config['loginname']) and !empty($config['qpassword']) and !empty($config['displayname'])) {
     try {
         $ts3 = TeamSpeak3::factory('serverquery://'.rawurlencode($config['loginname']).':'.rawurlencode($config['qpassword']).'@'.rawurlencode($config['ip']).':'.rawurlencode($config['queryport']).'?server_port='.rawurlencode($config['serverport']).'&nickname='.rawurlencode($config['displayname']));
     } catch (TeamSpeak3_Exception $e) {
         exit($e);
     }
     foreach ($ts3->clientList() as $ts3_Client) {
         if ($ts3_Client["client_type"] == 0 and $ts3_Client["connection_client_ip"] == getUserIp()) {
             foreach ($config['groups'] as $group) {                   <<<---------------------- Check if USER a Guest its True then He need to Poke with message its False no Poke
                 try {
               $ts3_Client->serverGroupClientAdd(intval($group), $ts3_Client->client_database_id);
                 if ($config['send_enable'] == true) {
                       if ($config['send_method'] == 'text') {
                           $ts3_Client->message($config['send_message'].$ts3->serverGroupGetById($group));
                       } else if ($config['send_method'] == 'poke'){
                           $ts3_Client->poke($config['send_message'].$ts3->serverGroupGetById($group));
                   }
                     }
                     log_write($ts3_Client->client_nickname." got assigned to a group (".$ts3->serverGroupGetById($group)." / ".$group.")", "Information");
                   } catch (Exception $e) {}
            }
        }
      }
}

THIS I MEAN ;)
<<<---------------------- Check if USER a Guest its True then He need to Poke with message its False no Poke
As i am not home and i am not able to check my code atm, when i go (in 2 hours max) i will check mine and i will let you know!
 
Top