02.07.2015, 22:17
hey how do i create an auto-unmute for this command?
some admins forgot to use /unmute. i need an auto unmute saying "%s(%d) have been automatically unmuted."
Код:
CMD:mute(playerid, params[]) { new str[128], reason[128], id, time; if(PlayerAcc[playerid][Log] == 0) return SendClientMessage(playerid, COLOR_RED, "Error: You are not logged in!"); if(PlayerAcc[playerid][Admin] >= 3) { if(sscanf(params, "uis[128]", id, time, reason)) return SendClientMessage(playerid, COLOR_RED, "Syntax: /mute (id) (minutes) (reason)"); if(id == INVALID_PLAYER_ID) return ErrorMessages(playerid, 2); if(id == playerid) return ErrorMessages(playerid, 4); if(PlayerAcc[id][Mute] == 1) return SendClientMessage(playerid, COLOR_RED, "That player is already mute!"); format(str, sizeof(str), "%s(%d) has been mute by Admin %s(%d) for %i minutes (for: %s)", GetName(id), id, GetName(playerid), playerid, time, reason); SendClientMessageToAll(COLOR_RED, str); format(str, sizeof(str), "You mute %s(%d) for %i minutes (for: %s)", GetName(id), id, time, reason); SendClientMessage(playerid, COLOR_YELLOW, str); PlayerAcc[id][Mute] = 1; PlayerAcc[id][MuteTime] = time*time; MuteTimer[id] = SetTimerEx("OnPlayerUnmute", PlayerAcc[id][MuteTime], false, "d", playerid); } else return ErrorMessages(playerid, 1); return 1; }