ploxarik

mute command

Feb 27th, 2021
157
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CMD:mute(playerid, params[])
  2. {
  3.     new string[30];
  4.     if(sscanf(params, "dds[100]",params[0],params[1],params[2])) return SendClientMessage(playerid, -1, "Use: /mute [id] [minute] [reason]");
  5.     if(params[1] < 1 || params[1] > 60) return SendClientMessage(playerid, -1, "Time from 1 minute to 60 minutes!");
  6.     if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, -1, "Player is not connected to the server.");
  7.     if(PlayerInfo[params[0]][estamute] > 0) return SendClientMessage(playerid, -1, "The player already has a mut.");
  8.     PlayerInfo[params[0]][estamute] = params[1]*60;
  9.     format(string, sizeof(string), "Administrator %s banned %s from chatting for %d minutes. Reason: %s",GetName(playerid),GetName(params[0]),params[1], params[2]);
  10.     SendClientMessageToAll(-1, string);
  11.     return 1;
  12. }
RAW Paste Data