(2021-07-30, 10:19 PM)Radical Wrote: Set a timer with 1 second interval?on OnGameModeInit() then decrease player mute time.One simple question: why.
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;
}
Here's the solution:
https://ideone.com/N0ciwe
Using Pawn.CMD?
If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.