Closed tanercanbilgin closed 2 years ago
you need to add something like this in the MuteList
class:
getByPlayerId(id) {
var index = this.list.findIndex(mutePlayer => mutePlayer.playerId === id);
if (index !== -1) {
return this.list[index];
}
return null;
}
and use it like so:
var playerUnmute = room.getPlayer(parseInt(msgArray[0]));
if (muteArray.getByPlayerId(playerUnmute.id) != null) {
var muteObj = muteArray.getByPlayerId(playerUnmute.id);
muteObj.remove()
room.sendAnnouncement(
`${playerUnmute.name} has been unmuted !`,
null,
announcementColor,
'normal',
HaxNotification.CHAT
);
room.setPlayerAvatar(playerUnmute.id, null);
}
of course the above code needs to be modified to fit into yours.
thank you so much, do you have discord?
thanks @iwishiknewcoding for spotting the mistake, just pushed the suggested fix
only unmute with mutelist works. can you check it