Mute- command
#8

pawn Код:
//Top of script
new Muted[MAX_PLAYERS];
pawn Код:
public OnPlayerText(playerid, text[])
{
  if(Muted[playerid] == 1)
  {
   SendClientMessage(playerid, RED, " You are muted and cannot talk. ");
   return 0;
  }
  return 1;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[256];
  new tmp[256];
  new idx;
  cmd = strtok(cmdtext, idx);

  if(strcmp(cmd, " /mute ", true) == 0)
  {
   if(IsPlayerAdmin(playerid))
   {
     tmp = strtok(cmdtext, idx);
     if(!strlen(tmp)) return SendClientMessage(playerid, color, " Usage: /mute [id] ");
     new giveplayerid = strval(tmp);
     if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, color, " Player not connected ! ");
     new name[24], name2[24], str[128];
     GetPlayerName(playerid, name, 24);
     GetPlayerName(giveplayerid, name2, 24);
     format(str, sizeof str, " Administrator %s has muted %s ", name, name2);
     SendClientMessageToAll(color, str);
     Muted[giveplayerid] = 1;
     return 1;
   }
   else return SendClientMessage(playerid, color, " Not an administrator! ");
  }
  return 0;
}
Reply


Messages In This Thread
Mute- command - by Jakku - 18.04.2009, 10:13
Re: Mute- command - by ReV. - 18.04.2009, 10:20
Re: Mute- command - by Rks25 - 18.04.2009, 10:57
Re: Mute- command - by Jakku - 18.04.2009, 11:17
Re: Mute- command - by Rks25 - 18.04.2009, 11:18
Re: Mute- command - by MenaceX^ - 18.04.2009, 11:24
Re: Mute- command - by ReV. - 19.04.2009, 02:04
Re: Mute- command - by Grim_ - 19.04.2009, 02:27
Re: Mute- command - by Jakku - 19.04.2009, 07:15
Re: Mute- command - by Grim_ - 19.04.2009, 07:17

Forum Jump:


Users browsing this thread: 2 Guest(s)