SA-MP Forums Archive
Mute Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Mute Command (/showthread.php?tid=239974)



Mute Command - Alex_Obando - 14.03.2011

I have this command but when they mute you you can speak
I want to add a timer too.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

 if(!strcmp(cmdtext, "/mute", true, 5))
{


    new Muted[MAX_PLAYERS];
   
if(!strlen(cmdtext[6]))
  {
    SendClientMessage(playerid, COLOR_RED, "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_RED, str);
    print(str);
    Muted[playerid] = 1;
  }
  return 1;

    }
    return 0;
}



AW: Mute Command - xerox8521 - 14.03.2011

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(Muted[playerid] == 1)
    {
    SendClientMessage(playerid,COLOR_RED,"You are muted. You can`t chat");
    return 0; // important must be 0
    }
    return 1;
}



Respuesta: Mute Command - Alex_Obando - 14.03.2011

Not working :/


Re: Mute Command - antonio112 - 14.03.2011

Ah, try putting the
pawn Код:
new Muted[MAX_PLAYERS];
as a global array, under #includes ... and delete the one in the command.