-
Notifications
You must be signed in to change notification settings - Fork 5
API methods guide
Starting from version 3.1.0, RealMute gives you three API methods that you can use in your code in order to make your plugin work with RealMute.
First, you need to assign RealMute to a variable:
$this->RealMute = $this->getServer()->getPluginManager()->getPlugin("RealMute");
Then you will be able to access RealMute API methods, like $this->RealMute->isMuted($player)
.
It is advised that you add the following line to plugin.yml
of your plugin, so if anyone uses your plugin without RealMute, there will not be any runtime error.
depend: RealMute
Checks if a player is muted, either muted by username or muted by device/IP address.
bool isMuted(mixed $player)
-
$player
The player you want to query.
Both player instance and player's name are accepted. RealMute will try to detect the type of$player
automatically.
Returns TRUE
if $player
is muted, FALSE
otherwise.
Mute a player.
bool mutePlayer(mixed $player)
-
$player
The player you want to mute.
Both player instance and player's name are accepted. RealMute will try to detect the type of$player
automatically.
Returns TRUE
if $player
is successfully muted, FALSE
otherwise.
Unmute a player.
bool unmutePlayer(mixed $player)
-
$player
The player you want to unmute.
Both player instance and player's name are accepted. RealMute will try to detect the type of$player
automatically.
Returns TRUE
if $player
is successfully unmuted, FALSE
otherwise.
Resources in RealMute Wiki are licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.