mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 06:25:32 +00:00
Fixed /help paging
This commit is contained in:
parent
d157299c7a
commit
e71b6946f3
@ -128,16 +128,16 @@ class ConsoleAPI{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$max = ceil(count($this->help) / 5);
|
$max = ceil(count($this->help) / 5);
|
||||||
$page = isset($params[0]) ? min($max - 1, max(0, intval($params[0]) - 1)):0;
|
$page = (int) (isset($params[0]) ? min($max, max(1, intval($params[0]))):1);
|
||||||
$output .= "- Showing help page ". ($page + 1) ." of $max (/help <page>) -\n";
|
$output .= "- Showing help page $page of $max (/help <page>) -\n";
|
||||||
$current = 0;
|
$current = 1;
|
||||||
foreach($this->help as $c => $h){
|
foreach($this->help as $c => $h){
|
||||||
$curpage = (int) ($current / 5);
|
$curpage = (int) ceil($current / 5);
|
||||||
if($curpage === $page){
|
if($curpage === $page){
|
||||||
$output .= "/$c ".$h."\n";
|
$output .= "/$c ".$h."\n";
|
||||||
}elseif($curpage > $page){
|
}elseif($curpage > $page){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
++$current;
|
++$current;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user