CMD:mutear(playerid, params[]) { if(Logged[playerid] == 1) { new string[128], targetid, time, reason[128]; if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, blanco, "{FF0000}ERROR:{FFFFFF} Usted no esta autorizado para usar este comando"); if(sscanf(params,"rds", targetid, time, reason)) return SendClientMessage(playerid, blanco, "USA:{FFFFFF} /mutear [ID] [Segundos] [Razon]"); if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, blanco, "{FF0000}ERROR:{FFFFFF} El jugador ya esta muteado"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, blanco, "{FF0000}ERROR:{FFFFFF} El jugador no esta conectado."); if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, blanco, "{FF0000}ERROR:{FFFFFF} Usted no puede mutear a ese jugador."); format(string, sizeof(string), "%s Ha sido muteado por %s.(%d Segundos)", GetName(targetid), reason, time); SendClientMessageToAll(COLOR_RED, string); KillTimer(PlayerInfo[targetid][pMutedTime]); PlayerInfo[targetid][pMuted] = 1; PlayerInfo[targetid][pMutedTime] = SetTimerEx("unmute",time*1000, 0, "i", targetid); } return 1; } |
PlayerInfo[playerid][pMuted] = 0;
under onplayerconnect/when they login. |
PlayerInfo[targetid][pMuted] = gettime() + (minutes * 60); // minutes is actually your time from the command OnPlayerText(playerid, text[]) { if(gettime() < PlayerInfo[playerid][pMuted]) { SendClientMessage(playerid, -1, "You can't talk while you are muted." return 0; } return 0; }