Advertisement
Kwarde

Mute Command (DCMD)

Oct 3rd, 2010
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.97 KB | None | 0 0
  1. #include <a_samp>
  2. #include <dcmd>
  3.  
  4. new bool:Muted[MAX_PLAYERS] = false;
  5.  
  6. public OnPlayerCommandText(playerid, cmdtext[])
  7. {
  8.     dcmd(mute, 4, cmdtext);
  9. }
  10.  
  11. dcmd_mute(playerid, params[])
  12. {
  13.     new id,string[128];
  14.     if(IsPlayerAdmin(playerid)){
  15.         if(sscanf(params, "i", id)) return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /mute [playerid]");
  16.         if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000AA, "That player isn't connected to the server!");
  17.         if(Muted[id] == false){
  18.             Muted[id] = true;
  19.             SendClientMessage(id, 0xFF0000AA, "You are muted!");
  20.         }
  21.         else{
  22.             Muted[id] = false;
  23.             SendClientMessage(id, 0x00FF00AA, "You are unmuted!");
  24.         }
  25.     }
  26.     return 1;
  27. }
  28.  
  29. public OnPlayerText(playerid, text[])
  30. {
  31.     if(Muted[playerid] == true){
  32.         SendClientMessage(playerid, 0xFF0000AA, "* You are muted! You can't talk!");
  33.         return 0;
  34.     }
  35.     return 1;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement