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?
!online customizable?
-
-
-
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
Alles anzeigenpublic 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); }
to:PHP
Alles anzeigenpublic 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); }
-
Trying it. Thanx alot
Edit:
works! -
Dieses Thema enthält 13 weitere Beiträge, die nur für registrierte Benutzer sichtbar sind.