1. GSManager
    1. Funktionen
    2. Unterstützte Spiele
    3. Neuigkeiten
    4. Statistiken
    5. Serverliste
  2. Lexikon
  3. Filebase
  4. Entwicklung
  5. Forum
    1. Dashboard
    2. Unerledigte Themen
  6. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  • Anmelden
  • Registrieren
  • Suche
Dieses Thema
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Artikel
  • Seiten
  • Dateien
  • Forum
  • Lexikon
  • Erweiterte Suche
  1. GSManager
  2. Forum
  3. Unterstützung
  4. Benutzung

!online customizable?

  • r3tox
  • 19. Februar 2011 um 18:58
Das Projekt GSManager (vormals ManuAdminMod) wurde am 01.01.2020 eingestellt - diese Internetpräsenz bleibt verfügbar, die Software wird aber nicht länger gepflegt. Vielen Dank für eure Unterstützung in den mehr als zehn vergangenen Jahren!
  • r3tox
    Anfänger
    Punkte
    260
    Beiträge
    43
    • 19. Februar 2011 um 18:58
    • #1

    Hi (again ;P)
    Is there a way to edit which groups the !online command displays?
    I have a few groups for admins and a group for "friends" (just protected, no admin rights).
    I want the command to list real admins only and not all ppl who are in a group. Possible?

  • Geventh
    Fortgeschrittener
    Punkte
    1.000
    Trophäen
    1
    Beiträge
    195
    • 20. Februar 2011 um 05:29
    • #2

    Hi,
    Yes it's possible: You have to edit the basiccommands.php file which is under the folder /plugins/.. .
    I haven't tried it yet: You won't get any further support by anyone else if it fails except me... (kind of core files)

    Change: line 535

    PHP
    public function online($guid, $parameters) {
    	   $admins = $this->mod->getAdmins();
    	   $online = array();
    	   foreach ($admins as $adminguid => $admin) {
    	       if (array_key_exists($adminguid, $this->players)) {
    	           $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);
    }
    Alles anzeigen


    to:

    PHP
    public function online($guid, $parameters) {
    	   $admins = $this->mod->getAdmins();
               $admingroups = array("masteradmin", "admin"); // change to choose which groups you want | add this line
    	   $online = array();
    	   foreach ($admins as $adminguid => $admin) {
                   $playergroup = $this->players[$adminguid]->getGroup(); // add this line
    	       if (array_key_exists($adminguid, $this->players) && in_array($playergroup, $admingroups)) { //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);
    }
    Alles anzeigen
  • r3tox
    Anfänger
    Punkte
    260
    Beiträge
    43
    • 20. Februar 2011 um 13:40
    • #3

    Trying it. Thanx alot

    Edit:
    works! ;)

    Einmal editiert, zuletzt von r3tox (20. Februar 2011 um 14:02)

  • Dieses Thema enthält 13 weitere Beiträge, die nur für registrierte Benutzer sichtbar sind.

Benutzer online in diesem Thema

  • 1 Besucher
  1. Mitarbeiter
  2. Datenschutzerklärung
  3. Nutzungsbedingungen
  4. Impressum
  5. Kontakt
Community-Software: WoltLab Suite™