Command-mute
#1

I need a command to mute player that he could not do any commands
Can you help me?
Reply
#2

To top:

pawn Код:
new Muted[MAX_PLAYERS];
Command:
pawn Код:
if(!strcmp(cmdtext, "/mute", true, 5))
{
  if(!strlen(cmdtext[6]))
  {
    SendClientMessage(playerid, COLOR_ORED, "Usage: /mute [playerid]");
    return 1;
  }
  new ID = strval(cmdtext[6]);
  new pName[24], str[64];
  if(IsPlayerConnected(ID))
  {
    GetPlayerName(ID, pName, 24);
    format(str, 64, "%s has been muted", pName);
    SendClientMessageToAll(COLOR_COLOR, str);
    print(str);
    Muted[playerid] = 1;
  }
  return 1;

    }
Under onplayercommandtext:

pawn Код:
if(Muted[playerid] == 1)
{
   SendClientMessage(playerid, COLOR_COLOR, "Error: You cannot use commands while muted!");
   return 0;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)