Hi,
Die Konstanten sind nicht definiert...
Geventh
Beiträge von Geventh
-
-
Benutzt du Promod live?
Geventh -
Am Besten löscht du alle Log-Dateien und startest den Game server neu wie auch MAM.
Hoffe es klappt dann.Geventh
-
Hi,
Kann es sein das zwei/mehere Server die gleiche Log-Datei benutzen? zB. games_mp1.log
Geventh -
Die Stats werden ja nur vom Root-Server gelesen und auf der Webpage dargestellt.
Und wie jetzt: iNoob, wo werden deine Stats abgespeichert? (Gameserver / Webspace)Geventh
-
Natürlich musst du dann nicht localhost schreiben.
Normalerweise ist es die ip.
Dann noch die Daten aus der config.cfg Datei.Danke für den Vorschlag Silva202: Gute Idee
-
Zitat
Free
10 gigabytes of storage space included!
Unlimited Traffic
PHP 5 / FTP / MySQL 5
Premium Support & large communityAlso PHP 5 sollte dabei sein...
Jetzt lädst du alle Dateien auf dein Webspace und bearbeitest die Config.php Datei. Öffne sie mit Editor..
PHP
Alles anzeigendefine("DB_SERVER","localhost"); // e.g.: define("DB_SERVER","localhost"); --> Server-Ip/Domain-Name define("DB_USER","root"); // e.g.: define("DB_USER","root"); --> MySQL-Username define("DB_PASSWORD",""); // e.g.: define("DB_PASSWORD","abc123"); --> MySQL-Password define("DB_NAME","mamstats"); // e.g.: define("DB_NAME","mamstats"); --> MySQL-Database-Name define("TBL_NICKS","mam01_nicks"); // e.g.: define("TBL_NICKS","mam01_nicks"); --> MySQL-Table 'NICKS' define("TBL_USER","mam01_user"); // e.g.: define("TBL_NICKS","mam01_user"); --> MySQL-Table 'USER'
-
Hi,
Hast du ein Webspace, wo PHP läuft? (Kann auch auf dem Gameserver sein)
Was hast du alles in der config.cfg Datei unter [statistics] und [statistics_mysql] geschrieben? (Bitte keine Passwörter ^^)
Funktioniert !stats, gibt es irgendwelche Probleme beim starten des Mods?Geventh
-
Sorry I don't understand you....
Where are you come from? -
Hi, Try this one:
PHP
Alles anzeigen$mod->registerEvent("playerJoined", "registered_main"); $mod->setDefaultCV("registered", "enabled", 1); $mod->setDefaultCV("registered", "kickreason", "->KICK_REASON<-"); //add KICK Reason here or make an config file $file = $configdir . "plugins/whitelist.lst"; // path to your file, place it in your configfolder into folder plugins $results = explode(",", file_get_contents($file)); $whitelist = array(); foreach($results as $result) { $whitelist[] = trim($result); } function registered_main($guid) { global $mod, $players,$whitelist; if($mod->getCV("registered", "enabled") == 0) { return; } if (!in_array($guid, $whitelist)) { $players[$guid]->kick($mod->getCV("registered", "kickreason")); } }
-
PHP
Alles anzeigen$mod->registerEvent("playerJoined", "registered_main"); $mod->setDefaultCV("registered", "enabled", 1); $mod->setDefaultCV("registered", "kickreason", "Molimo registrajte se na www.h8breed.com"); $file = $configdir . "plugins/whitelist.lst"; // path to your file, place it in your configfolder into folder plugins $results = explode(",", file_get_contents($file)); $whitelist = array(); foreach($results as $result) { $whitelist[] = trim($result); } function registered_main($guid) { global $mod, $players; $usersreg = array("guid","guid","guid"); if($mod->getCV("registered", "enabled") == 0) { return; } if (!in_array($guid, $whitelist)) { $players[$guid]->kick($mod->getCV("registered", "kickreason")); } }
-
And who add the GUIDs?
The mod? Then how?
You yourself? -
You have to restart the mod when you change/add php code!!
-
Just replace this code:
PHP
Alles anzeigenpublic function online($guid, $parameters) { $admins = $this->mod->getAdmins(); $online = array(); $results = explode("," , $this->mod->getCV("main", "onlineshowngroups")); $onlineshowngroups = array(); foreach($results as $result) { $onlineshowngroups[] = trim($result); } foreach ($admins as $adminguid => $admin) { if (array_key_exists($adminguid, $this->players) && in_array($this->players[$adminguid]->getGroup(), $onlineshowngroups)) { $online[] = array( "nick" => $this->players[$adminguid]->getName(), "group" => $this->players[$adminguid]->getGroup() ); } } $str = $this->mod->getLngString("onlineadmins") . " "; if (count($online) > 0) { foreach ($online as $admin) { $str .= "^2" . $admin["nick"] . " ^1(" . $this->mod->getLongGroupName($admin["group"]) . ")^7, "; } $str = substr($str, 0, -4); } else { $str .= $this->mod->getLngString("onlineAdminsNone"); } $this->players[$guid]->say($str); }
-
Hi,
What do you exactly want to log?Geveth
-
-
Hi,
Cleaned version:PHP
Alles anzeigen$mod->registerEvent("playerJoined", "registered_main"); $mod->setDefaultCV("registered", "enabled", 1); $mod->setDefaultCV("registered", "kickreason", "Molimo registrajte se na www.h8breed.com"); function registered_main($guid) { global $mod, $players; $usersreg = array("guid","guid","guid"); if($mod->getCV("registered", "enabled") == 0) { return; } if (!in_array($guid, $usersreg)) { $players[$guid]->kick($mod->getCV("registered", "kickreason")); } }
-
Lol...
Can you show me a screenshot or the logs?
Perhabs some stupid mistakes from my side....Geventh
-
hmm you have added all groups?
You should only add those groups you wish to see in the list.
Can you show me a screenshot?
The changelog is only in german at the moment: click hereedit my fault:
PHP
Alles anzeigenpublic function online($guid, $parameters) { $admins = $this->mod->getAdmins(); $online = array(); //add those lines --> $results = explode("," , $this->mod->getCV("main", "onlineshowngroups")); $onlineshowngroups = array(); foreach($results as $result) { $onlineshowngroups[] = trim($result); } // <-- foreach ($admins as $adminguid => $admin) { $playergroup = $this->players[$adminguid]->getGroup(); // add this line here if (array_key_exists($adminguid, $this->players) && in_array($playergroup, $onlineshowngroups)) { // change this line $online[] = array( "nick" => $this->players[$adminguid]->getName(), "group" => $playergroup // change this line ); } } $str = $this->mod->getLngString("onlineadmins") . " "; if (count($online) > 0) { foreach ($online as $admin) { $str .= "^2" . $admin["nick"] . " ^1(" . $this->mod->getLongGroupName($admin["group"]) . ")^7, "; } $str = substr($str, 0, -4); } else { $str .= $this->mod->getLngString("onlineAdminsNone"); } $this->players[$guid]->say($str); }
Geventh
-
Ok, In v0.12 this public function will look different, so beware of that.
It seems to look like what you wished.
I think you have to edit the config file where you have to put the groups in.Changelog from v12.0 BETA:
The code may look like that:
In the config.cfg file -> under section [main] (first section) --> add at the end the line:
The PHP code:
PHP
Alles anzeigenpublic function online($guid, $parameters) { $admins = $this->mod->getAdmins(); $online = array(); //add those lines --> $results = explode("," , $this->mod->getCV("main", "onlineshowngroups")); $onlineshowngroups = array(); foreach($results as $result) { $onlineshowngroups[] = trim($result); } $playergroup = $this->players[$adminguid]->getGroup(); // <-- foreach ($admins as $adminguid => $admin) { if (array_key_exists($adminguid, $this->players) && in_array($playergroup, $onlineshowngroups)) { // change this line $online[] = array( "nick" => $this->players[$adminguid]->getName(), "group" => $playergroup // change this line ); } } $str = $this->mod->getLngString("onlineadmins") . " "; if (count($online) > 0) { foreach ($online as $admin) { $str .= "^2" . $admin["nick"] . " ^1(" . $this->mod->getLongGroupName($admin["group"]) . ")^7, "; } $str = substr($str, 0, -4); } else { $str .= $this->mod->getLngString("onlineAdminsNone"); } $this->players[$guid]->say($str); }
Can you try that out?