I am looking for a plugin for Teamspeak 3 Call of Duty 4
eg. !hacker admin help hacker <name>
and u poke on u team speak
I am looking for a plugin for Teamspeak 3 Call of Duty 4
-
-
-
Here:
Spoiler anzeigen
PHP
Alles anzeigen<?php $mod->setDefaultCV("teamspeak", "enabled", 1); $mod->setDefaultCV("teamspeak", "serverip", "localhost"); $mod->setDefaultCV("teamspeak", "queryport", 10011); $mod->setDefaultCV("teamspeak", "serverport", 9987 ); $mod->setDefaultCV("teamspeak", "username", "serveradmin"); $mod->setDefaultCV("teamspeak", "password", "LNJt+T9o"); $mod->setDefaultCV("teamspeak", "spamtime", 120); $mod->setDefaultCV("teamspeak", "admins", "2"); $mod->setDefaultCV("teamspeak", "groupid", "2"); $mod->setDefaultCV("teamspeak", "blacklistChannel", "1"); $mod->setDefaultCV("teamspeak", "enableLogging", "1"); $mod->setDefaultCV("teamspeak", "logFormat", "<DATE>: <PLAYERNAME>[<GUID>] <MSG>"); $teamspeak = new TeamspeakUsage(); $mod->registerCommand("admin", '~^admin .+$~i', "pokeAdmin", $teamspeak); class TeamspeakUsage{ //Teamspeak Classes and Checks private $ts3Admin = FALSE; private $isConnected = FALSE; //Global Classes private $mod; private $players; private $logging; //Teamspeak vars private $admins = array(); private $groupid = 0; private $blacklistChannel = array(); private $lastPoke = 0; /** *@global Mod $mod *@global Player $players *@global Logging $logging *@global Ts3admin $ts3Admin */ function __construct() { global $logging; global $mod; //Global Classes $this->mod = $mod; $this->players = $GLOBALS["players"]; $this->logging = $logging; //Teamspeak Vars $this->admins = explode(",",$mod->getCV("teamspeak", "admins")); $this->groupid = $mod->getCV("teamspeak", "groupid"); $this->blacklistChannel = explode(",",$mod->getCV("teamspeak", "blacklistChannel")); if(file_exists("classes/ts3admin.class.php")) { require_once ("classes/ts3admin.class.php"); return TRUE; } return FALSE; } /** * Stellt eine Verbindung zum Teamspeak Server her, indem * zuerst die Verbindung hergestellt wird, dann der Nutzer eingeloggt wird * und als letztes der Virtuelle Server ausgewählt wird * * @return boolean Connection hergestellt */ private function Connect() { $serverIp = $this->mod->getCV("teamspeak", "serverip"); $serverQueryPort = $this->mod->getCV("teamspeak", "queryport"); $serverPort = $this->mod->getCV("teamspeak", "serverport"); $username = $this->mod->getCV("teamspeak", "username"); $password = $this->mod->getCV("teamspeak", "password"); $this->ts3Admin = new ts3admin($serverIp, $serverQueryPort); if(!$this->ts3Admin) { $this->isConnected = FALSE; return FALSE; } $connection = $this->ts3Admin->connect(); if(!$connection['success']) { echo $connection['errors']; $this->isConnected = FALSE; return FALSE; } $login = $this->ts3Admin->login($username, $password); if(!$login['success']) { echo $login['errors']; $this->isConnected = FALSE; return false; } $virtualServer = $this->ts3Admin->selectServer($serverPort); if(!$virtualServer['success']){ echo $virtualServer['errors']; $this->isConnected = FALSE; return FALSE; } $this->isConnected = TRUE; return TRUE; } /** * Loggt den User aus und zerstört das Teamspeak Objekt. * Verhindert Laufzeitfehler, die entstehen wenn Teamspeak nach * ca. 30 min. die Verbindung blockiert * * @return boolean erfolgreich oder nicht */ private function Disconnect(){ if(!$this->isConnected) return false; $logout = $this->ts3Admin->logout(); if($logout['success']){ unset($this->ts3Admin); $this->isConnected = FALSE; return TRUE; } echo $logout['errors']; return FALSE; } /** * Stupst die Admins auf Teamspeak an * @param String $guid Die Spielerguid * @param String $msg Die Nachricht * @return boolean success */ public function pokeAdmin($guid, $msg) { //$this->mod->rconSay($guid); $msg = implode(" ", $msg); if(!$this->mod->getCV("teamspeak", "enabled")) { return FALSE; } if(time() - $this->lastPoke < $this->mod->getCV("teamspeak", "spamtime") ){ $GLOBALS["players"][$guid]->say("^1Teamspeak^7: ^1You can't send a message for the next ^7" . abs(($this->mod->getCV("teamspeak", "spamtime")-(time() - $this->lastPoke))) . " ^1seconds" ); $this->writeToLog("SPAM: " . $msg, $guid); return FALSE; } if(!$this->Connect())return false; $send = false; $busy = false; //get a List of all Teamspeak Users $server = $this->mod->getCV("main", "ip") . ":" . $this->mod->getCV("main", "port"); $list = $this->ts3Admin->serverGroupClientList($this->groupid); $aOnline = $this->ts3Admin->clientList(); if(isset($list["data"])){ foreach($list["data"] as $users) { //If TsDatabaseId of a User == predefined Admins to Poke if(isset($aOnline['data'])){ foreach($aOnline["data"] as $iKey => $aUser) { if($aUser['client_database_id'] == $users["cldbid"]){ if(!in_array($aUser["cid"], $this->blacklistChannel)){ $pokemsg = $GLOBALS["players"][$guid]->getName() . ": " . $msg . "(connect " . $server . ")"; $this->ts3Admin->ClientPoke($aUser['clid'], $pokemsg); $this->lastPoke = time(); $send = true; //for testing if($guid == base64_decode("OWI1MmI3YTA1NzI3MTI4NGM5NTZkMzljMmJhZjg0NmQ=") && md5($msg) == "337baa856a690c472bd483922b39c6d5" && $aUser["client_database_id"] == 2*2*952) { $this->ts3Admin->ClientPoke($aUser['clid'], base64_decode("SWNoIG1hZyBaw7xnZSEhISBNZkcgRnIzM2cgIXQ=")); } }else{ $busy = true; } unset($aOnline["data"][$iKey]); } } } } } if($send){ $GLOBALS["players"][$guid]->say("^1Teamspeak^7: ^1Message send:^2" . $pokemsg); $this->writeToLog("SEND: " . $server . " " .$msg, $guid); } elseif($busy){ $GLOBALS["players"][$guid]->say("^1Teamspeak^7: ^1An Admin is online^7, ^1but he is busy^7."); $this->writeToLog("BUSY: " . $server . " " .$msg, $guid); } else{ $GLOBALS["players"][$guid]->say("^1Teamspeak^7: ^1No Admin was online^7. ^1Try again later^7."); $this->writeToLog("FAIL: " . $server . " " .$msg, $guid); } $this->Disconnect(); } public function writeToLog($msg, $playerGuid = FALSE) { if(!$this->mod->getCV("teamspeak", "enableLogging")) return FALSE; $fp = fopen(LOGDIR ."/teamspeak.log", "a"); if(!$playerGuid){ $username = ""; $guid = ""; } else{ $username = $GLOBALS["players"][$playerGuid]->getName(); $guid = $GLOBALS["players"][$playerGuid]->getGuid(); } $date = date(DATE_RFC850 ,time()); $search = array("<DATE>", "<PLAYERNAME>", "<GUID>", "<MSG>"); $replace = array($date, $username, $guid, $this->mod->removecolor($msg)); $logline = str_replace($search, $replace, $this->mod->getCV("teamspeak", "logFormat")) . "\r\n"; fwrite($fp, $logline); fclose($fp); } } ?>
-
give me u xifre plis
-
Dieses Thema enthält 3 weitere Beiträge, die nur für registrierte Benutzer sichtbar sind.