Rechte sind richtig
der mod wird als laufend angezeigt aber er macht nichts wenn ich die stats.sqlite3.db lösche
Rechte sind richtig
der mod wird als laufend angezeigt aber er macht nichts wenn ich die stats.sqlite3.db lösche
Moin
wäre es möglich einen Befehl mit in die Statistic.php aufzunehmen, dass man alle Stats zurücksetzten kann und nicht nur die von einzelnen Spielern
bisher geht ja nur !resetplayerstats oder !resetmystats
so das es über z.B. !resetallplayerstats funktionieren würde
denn ich bekomme irgendwie die stats.sqlite3.db nicht gelöscht :crying: und wir würden gerne alle 3 Monate die stats zurücksetzten
Gruß Nofi
Moin erstmal
seid gestern läuft bei uns der manu mod nicht mehr nachdem ich server neu starten musste
fehler lag beim anbieter
da die Uhrzeit am Server anders ist , sieht man eine falsche ingame Zeit. :crying:
kann man das nicht irgendwie über die Funktions PHP ändern das man da 2 Std abzieht und somit die Zeit wieder stimmt
<?php
/**
* PROJECT: ManuAdminMod (0.12 Beta)
//Funktionen
function makeuptime($time) //Generiert aus Minuten Tage, Stunden und Minuten
{
$minuten = $time % 60;
$weiter = ($time - $minuten) / 60;
$stunden = $weiter % 24;
$tage = ($weiter - $stunden) / 24;
return sprintf("%dD %02d:%02d", (int)$tage, (int)$stunden, (int)$minuten);
}
function makeuptime2 ($time) //Generiert aus Sekunden Stunden, Minuten und Sekunden
{
$sekunden = $time % 60;
$weiter = ($time - $sekunden) / 60;
$minuten = $weiter % 60;
$stunden = ($weiter - $minuten) / 60;
return sprintf("%02d:%02d:%02d", (int)$stunden, (int)$minuten, (int)$sekunden);
}
function __autoload($class_name) {
require_once "classes/" . $class_name . '.class.php';
}
function error_handler($errno, $errstr, $errfile, $errline) {
global $logging;
if (error_reporting() == 0) return;
Danke klappt jetzt super :smile:
komme damit nicht so ganz klar
kannst du mir die php vieleicht so fertig machen wie es sein soll?
hab ma die php angefügt
hatte das ereg() durch preg_match() ersetzt
<?php
$mod->registerEvent("playerJoined", "iplogger_log_joined");
$mod->registerEvent("playerNameChange", "iplogger_log_namechange");
$mod->registerEvent("playerJoined", "iplogger_log_sorted_joined");
$mod->registerEvent("playerNameChange", "iplogger_log_sorted_namechange");
$mod->setDefaultCV("iplog", "enabled", "1");
$mod->setDefaultCV("iplog", "S_enabled", "1");
$mod->setDefaultCV("iplog", "dateformat", "d.n.Y, G:i");
$mod->setDefaultCV("iplog", "logformat_joined", "[{date}] {action}: -- Name: {name} - IP: {ip} - GUID: {guid}{break}");
$mod->setDefaultCV("iplog", "logformat_namechange", "[{date}] {action}: -- Old: {oldname} - New: {newname} - IP: {ip} - GUID: {guid}{break}");
function iplogger_log_joined($guid) {
global $mod;
global $players;
if(!$mod->getCV("iplog", "enabled")) {
return;
}
$iplog_fp_log = fopen($mod->getConfigDir()."/plugins/iplogger_log.txt", "a");
$action = "Player joined";
$playerlist = $mod->rconPlayerlist();
foreach ($playerlist as $value) {
if ($guid == $value["guid"]) {
$name = $value["name"];
$ip = $value["ip"];
$name = $mod->removecolor($name);
$log_text = replacetext($action, $name, $ip, $guid);
fwrite($iplog_fp_log, replacetext($action, $name, $ip, $guid));
fclose($iplog_fp_log);
}
}
}
function iplogger_log_namechange($param) {
global $mod;
global $players;
if(!$mod->getCV("iplog", "enabled")) {
return;
}
$name = false;
$iplog_fp_log = fopen($mod->getConfigDir()."/plugins/iplogger_log.txt", "a");
list($guid, $old_name, $new_name) = $param;
$action = "Player changed name";
$playerlist = $mod->rconPlayerlist();
foreach ($playerlist as $value) {
if ($guid == $value["guid"]) {
$ip = $value["ip"];
$name_old = $mod->removecolor($old_name);
$name_new = $mod->removecolor($new_name);
$log_text = replacetext($action, $name, $ip, $guid, $old_name, $new_name);
fwrite($iplog_fp_log, replacetext($action, $name, $ip, $guid, $old_name, $new_name));
fclose($iplog_fp_log);
break;
}
}
}
function iplogger_log_sorted_joined ($guid) {
global $mod;
global $players;
if(!$mod->getCV("iplog", "S_enabled")) {
return;
}
$playerlist = $mod->rconPlayerlist();
foreach ($playerlist as $value) {
if ($guid == $value["guid"]) {
$name = $value["name"];
$ip = $value["ip"];
break;
}
}
$name = $mod->removecolor($name);
$file = $mod->getConfigDir()."/plugins/iplogger_guid.txt";
$arr_sorted_log = file($file);
$change_arr = false;
if($key_guid = array_search("[".$guid."]\n", $arr_sorted_log) and $key_guid >= 0) {
$key_ip = $key_guid+1;
$key_name = $key_guid+2;
if(!preg_match("'".$ip."'", $arr_sorted_log[$key_ip])) {
$arr_sorted_log[$key_ip] = str_replace("\n", "", $arr_sorted_log[$key_ip]);
$arr_sorted_log[$key_ip].= " '".$ip."';\n";
$change_arr = true;
}
if(!preg_match("'".$name."'", $arr_sorted_log[$key_name])) {
$arr_sorted_log[$key_name] = str_replace("\n", "", $arr_sorted_log[$key_name]);
$arr_sorted_log[$key_name].= " '".$name."';\n";
$change_arr = true;
}
if($change_arr) {
$write_string = implode("", $arr_sorted_log);
$iplog_fp_sort = fopen($mod->getConfigDir()."/plugins/iplogger_guid.txt", "w");
fwrite($iplog_fp_sort, $write_string);
fclose($iplog_fp_sort);
}
} else {
$arr_write = array();
$arr_write[0] = " ";
$arr_write[1] = "[".$guid."]";
$arr_write[2] = "IPs : '".$ip."';";
$arr_write[3] = "Names: '".$name."';\n";
$write_string = implode("\n", $arr_write);
$iplog_fp_sort = fopen($mod->getConfigDir()."/plugins/iplogger_guid.txt", "a");
fwrite($iplog_fp_sort, $write_string);
fclose($iplog_fp_sort);
}
}
function iplogger_log_sorted_namechange($params) {
global $mod;
global $players;
if(!$mod->getCV("iplog", "S_enabled")) {
return;
}
list($guid, $oldname, $newname) = $params;
$oldname = $mod->removecolor($oldname);
$newname = $mod->removecolor($newname);
$file = $mod->getConfigDir()."/plugins/iplogger_guid.txt";
$arr_sorted_log = file($file);
$change_arr = false;
if($key_guid = array_search("[".$guid."]\n", $arr_sorted_log) and $key_guid >= 0) {
$key_name = $key_guid+2;
if(!preg_match("'".$newname."'", $arr_sorted_log[$key_name])) {
$arr_sorted_log[$key_name] = str_replace("\n", "", $arr_sorted_log[$key_name]);
$arr_sorted_log[$key_name].= " '".$newname."';\n";
$change_arr = true;
}
if($change_arr) {
$write_string = implode("", $arr_sorted_log);
$iplog_fp_sort = fopen($file, "w");
fwrite($iplog_fp_sort, $write_string);
fclose($iplog_fp_sort);
}
} else {
$arr_write = array();
$arr_write[0] = " ";
$arr_write[1] = "[".$guid."]";
$arr_write[2] = "IPs :";
$arr_write[3] = "Names: '".$newname."';\n";
$write_string = implode("\n", $arr_write);
$iplog_fp_sort = fopen($file, "a");
fwrite($iplog_fp_sort, $write_string);
fclose($iplog_fp_sort);
}
}
function replacetext($action, $name, $ip, $guid, $oldname=false, $newname=false) {
global $mod;
if($action == "Player joined") {
$logformat = $mod->getCV("iplog", "logformat_joined");
$logformat = str_replace("{date}", date($mod->getCV("iplog", "dateformat")), $logformat);
$logformat = str_replace("{action}", $action, $logformat);
$logformat = str_replace("{name}", $name, $logformat);
$logformat = str_replace("{ip}", $ip, $logformat);
$logformat = str_replace("{guid}", $guid, $logformat);
$logformat = str_replace("{break}", "\n", $logformat);
} else {
$logformat = $mod->getCV("iplog", "logformat_namechange");
$logformat = str_replace("{date}", date($mod->getCV("iplog", "dateformat")), $logformat);
$logformat = str_replace("{action}", $action, $logformat);
$logformat = str_replace("{oldname}", $oldname, $logformat);
$logformat = str_replace("{newname}", $newname, $logformat);
$logformat = str_replace("{ip}", $ip, $logformat);
$logformat = str_replace("{guid}", $guid, $logformat);
$logformat = str_replace("{break}", "\n", $logformat);
}
return $logformat;
}
?>
Danke
aber jetzt habe ich folgende PHP-Error
PHP-Error: Notice in xx/xxx/CallofDuty4-170/adminmod/plugins/iplogger.php:83 => Undefined variable: name
PHP-Error: Notice in xx/xxx/CallofDuty4-170/adminmod/plugins/iplogger.php:92 => Undefined variable: ip
83 $name = $mod->removecolor($name);
84 $file = $mod->getConfigDir()."/plugins/iplogger_guid.txt";
85 $arr_sorted_log = file($file);
86 $change_arr = false;
88 if($key_guid = array_search("[".$guid."]\n", $arr_sorted_log) and $key_guid >= 0) {
89 $key_ip = $key_guid+1;
90 $key_name = $key_guid+2;
92 if(!preg_match("'".$ip."'", $arr_sorted_log[$key_ip])) {
93 $arr_sorted_log[$key_ip] = str_replace("\n", "", $arr_sorted_log[$key_ip]);
94 $arr_sorted_log[$key_ip].= " '".$ip."';\n";
95 $change_arr = true;
ich habe ein Problem wenn jemand auf unserem server joint kommt Fehlermeldung
03-Mar-2014 18:12:14 UTC] PHP Notice: Undefined offset: 8192 in /xxx/xxx/CallofDuty4-170/adminmod/internals/functions.php on line 57
20:19 [03.03.14 19:12:14] PHP-Error: in home/s115429/CallofDuty4-170/adminmod/plugins/iplogger.php:92 => Function ereg() is deprecated
[03-Mar-2014 18:12:14 UTC] PHP Notice: Undefined offset: 8192 in /xxx/xxx/CallofDuty4-170/adminmod/internals/functions.php on line 57
20:19 [03.03.14 19:12:14] PHP-Error: in home/s115429/CallofDuty4-170/adminmod/plugins/iplogger.php:97 => Function ereg() is deprecated
woran liegt das bzw wie kann ich es beheben
habe ip logger php angehangen
ZitatAlles anzeigen<?php
$mod->registerEvent("playerJoined", "iplogger_log_joined");
$mod->registerEvent("playerNameChange", "iplogger_log_namechange");$mod->registerEvent("playerJoined", "iplogger_log_sorted_joined");
$mod->registerEvent("playerNameChange", "iplogger_log_sorted_namechange");$mod->setDefaultCV("iplog", "enabled", "1");
$mod->setDefaultCV("iplog", "S_enabled", "1");
$mod->setDefaultCV("iplog", "dateformat", "d.n.Y, G:i");
$mod->setDefaultCV("iplog", "logformat_joined", "[{date}] {action}: -- Name: {name} - IP: {ip} - GUID: {guid}{break}");
$mod->setDefaultCV("iplog", "logformat_namechange", "[{date}] {action}: -- Old: {oldname} - New: {newname} - IP: {ip} - GUID: {guid}{break}");function iplogger_log_joined($guid) {
global $mod;
global $players;if(!$mod->getCV("iplog", "enabled")) {
return;
}
$iplog_fp_log = fopen($mod->getConfigDir()."/plugins/iplogger_log.txt", "a");
$action = "Player joined";
$playerlist = $mod->rconPlayerlist();foreach ($playerlist as $value) {
if ($guid == $value["guid"]) {
$name = $value["name"];
$ip = $value["ip"];
$name = $mod->removecolor($name);
$log_text = replacetext($action, $name, $ip, $guid);fwrite($iplog_fp_log, replacetext($action, $name, $ip, $guid));
fclose($iplog_fp_log);}
}
}function iplogger_log_namechange($param) {
global $mod;
global $players;if(!$mod->getCV("iplog", "enabled")) {
return;
}
$name = false;
$iplog_fp_log = fopen($mod->getConfigDir()."/plugins/iplogger_log.txt", "a");
list($guid, $old_name, $new_name) = $param;
$action = "Player changed name";
$playerlist = $mod->rconPlayerlist();foreach ($playerlist as $value) {
if ($guid == $value["guid"]) {
$ip = $value["ip"];
$name_old = $mod->removecolor($old_name);
$name_new = $mod->removecolor($new_name);
$log_text = replacetext($action, $name, $ip, $guid, $old_name, $new_name);
fwrite($iplog_fp_log, replacetext($action, $name, $ip, $guid, $old_name, $new_name));
fclose($iplog_fp_log);
break;
}
}
}function iplogger_log_sorted_joined ($guid) {
global $mod;
global $players;
if(!$mod->getCV("iplog", "S_enabled")) {
return;
}
$playerlist = $mod->rconPlayerlist();
foreach ($playerlist as $value) {
if ($guid == $value["guid"]) {
$name = $value["name"];
$ip = $value["ip"];
break;
}
}
$name = $mod->removecolor($name);
$file = $mod->getConfigDir()."/plugins/iplogger_guid.txt";
$arr_sorted_log = file($file);
$change_arr = false;
if($key_guid = array_search("[".$guid."]\n", $arr_sorted_log) and $key_guid >= 0) {
$key_ip = $key_guid+1;
$key_name = $key_guid+2;
if(!ereg("'".$ip."'", $arr_sorted_log[$key_ip])) {
$arr_sorted_log[$key_ip] = str_replace("\n", "", $arr_sorted_log[$key_ip]);
$arr_sorted_log[$key_ip].= " '".$ip."';\n";
$change_arr = true;
}
if(!ereg("'".$name."'", $arr_sorted_log[$key_name])) {
$arr_sorted_log[$key_name] = str_replace("\n", "", $arr_sorted_log[$key_name]);
$arr_sorted_log[$key_name].= " '".$name."';\n";
$change_arr = true;
}
if($change_arr) {
$write_string = implode("", $arr_sorted_log);
$iplog_fp_sort = fopen($mod->getConfigDir()."/plugins/iplogger_guid.txt", "w");
fwrite($iplog_fp_sort, $write_string);
fclose($iplog_fp_sort);
}} else {
$arr_write = array();
$arr_write[0] = " ";
$arr_write[1] = "[".$guid."]";
$arr_write[2] = "IPs : '".$ip."';";
$arr_write[3] = "Names: '".$name."';\n";
$write_string = implode("\n", $arr_write);
$iplog_fp_sort = fopen($mod->getConfigDir()."/plugins/iplogger_guid.txt", "a");
fwrite($iplog_fp_sort, $write_string);
fclose($iplog_fp_sort);
}
}function iplogger_log_sorted_namechange($params) {
global $mod;
global $players;
if(!$mod->getCV("iplog", "S_enabled")) {
return;
}
list($guid, $oldname, $newname) = $params;
$oldname = $mod->removecolor($oldname);
$newname = $mod->removecolor($newname);
$file = $mod->getConfigDir()."/plugins/iplogger_guid.txt";
$arr_sorted_log = file($file);
$change_arr = false;
if($key_guid = array_search("[".$guid."]\n", $arr_sorted_log) and $key_guid >= 0) {
$key_name = $key_guid+2;
if(!ereg("'".$newname."'", $arr_sorted_log[$key_name])) {
$arr_sorted_log[$key_name] = str_replace("\n", "", $arr_sorted_log[$key_name]);
$arr_sorted_log[$key_name].= " '".$newname."';\n";
$change_arr = true;
}
if($change_arr) {
$write_string = implode("", $arr_sorted_log);
$iplog_fp_sort = fopen($file, "w");
fwrite($iplog_fp_sort, $write_string);
fclose($iplog_fp_sort);
}
} else {
$arr_write = array();
$arr_write[0] = " ";
$arr_write[1] = "[".$guid."]";
$arr_write[2] = "IPs :";
$arr_write[3] = "Names: '".$newname."';\n";
$write_string = implode("\n", $arr_write);
$iplog_fp_sort = fopen($file, "a");
fwrite($iplog_fp_sort, $write_string);
fclose($iplog_fp_sort);
}}
function replacetext($action, $name, $ip, $guid, $oldname=false, $newname=false) {
global $mod;
if($action == "Player joined") {
$logformat = $mod->getCV("iplog", "logformat_joined");
$logformat = str_replace("{date}", date($mod->getCV("iplog", "dateformat")), $logformat);
$logformat = str_replace("{action}", $action, $logformat);
$logformat = str_replace("{name}", $name, $logformat);
$logformat = str_replace("{ip}", $ip, $logformat);
$logformat = str_replace("{guid}", $guid, $logformat);
$logformat = str_replace("{break}", "\n", $logformat);
} else {
$logformat = $mod->getCV("iplog", "logformat_namechange");
$logformat = str_replace("{date}", date($mod->getCV("iplog", "dateformat")), $logformat);
$logformat = str_replace("{action}", $action, $logformat);
$logformat = str_replace("{oldname}", $oldname, $logformat);
$logformat = str_replace("{newname}", $newname, $logformat);
$logformat = str_replace("{ip}", $ip, $logformat);
$logformat = str_replace("{guid}", $guid, $logformat);
$logformat = str_replace("{break}", "\n", $logformat);
}
return $logformat;
}
?>
Hallo :grin:
Wo kann ich die Uhrzeit ändern da seid der adminmod 012 auf dem server läuft geht die Uhr 2 Stunden vor
bei !Time
Moin :confused:
Mir ist gestern Aufgefallen das wenn man !nextmap eingibt , dann ist ein Umlaut fehler bei Nächste Map ist ....
es steht dann NÄ¿½chste Map ist....
Hab jetzt selber diesen Fehler gefunden :smile:
Für alle die dieses Prob auch haben in languages /de die main.lng und basic.lng bearbeiten