Set a timer with 1 second interval?on OnGameModeInit() then decrease player mute time.
Also if you want check player is muted you just need check the?PlayerInfo[playerid][pMuted] is not 0.
Code:
public OneSecondPlayerTimer() {
? ? foreach(new i: Player) {
? ? ? ? PlayerMuteCheck(i);
? ? }
}
PlayerMuteCheck(playerid) {
? ? if(PlayerInfo [playerid] [pMuted] == 1) {
? ? ? ? PlayerInfo [playerid] [pMuted]--;
? ? ? ? SendClientMessage(playerid, -1, "Mute time expired.");
? ? }
? ? if(PlayerInfo [playerid] [pMuted] > 1) PlayerInfo [playerid] [pMuted]--;
}
Also if you want check player is muted you just need check the?PlayerInfo[playerid][pMuted] is not 0.
Code:
IsPlayerMuted(playerid) {
? ? if(PlayerInfo[playerid][pMuted] == 0) return 0;
? ? return 1;
}