Disable / enable a command
#2

pawn Код:
new RestrictCMD;

public OnPlayerCommandText(playerid, cmdtext[])
{
  if(!strcmp(cmdtext, "/Blockcmd", true)
  {
    if(!IsPlayerAdmin(playerid)) return 0;
    if(RestrictCMD == 0)
    {
      RestrictCMD = 1;
      SendClientMessage(playerid, COLOR, "Restricted the command");
    }
    if(RestrictCMD == 1)
    {
      RestrictCMD = 0;
      SendClientMessage(playerid, COLOR, "Un-restricted the command");
    }
  }
  if(!strcmp(cmdtext, "/Randomcmd", true)
  {
    if(RestrictCMD == 1) return 0;
    //Rest of command here
  }
  return 0;
}
Hope it helped
~[HiC]TheKiller
Reply


Messages In This Thread
Disable / enable a command - by rellyboy105 - 05.06.2010, 23:26
Re: Disable / enable a command - by [HiC]TheKiller - 06.06.2010, 01:51
Re: Disable / enable a command - by Antonio [G-RP] - 06.06.2010, 01:55
Re: Disable / enable a command - by [HiC]TheKiller - 06.06.2010, 01:58
Re: Disable / enable a command - by rellyboy105 - 06.06.2010, 02:53
Re: Disable / enable a command - by Scenario - 06.06.2010, 02:57
Re: Disable / enable a command - by Antonio [G-RP] - 06.06.2010, 02:58
Re: Disable / enable a command - by rellyboy105 - 06.06.2010, 02:59
Re: Disable / enable a command - by [HiC]TheKiller - 06.06.2010, 03:05
Re: Disable / enable a command - by rellyboy105 - 06.06.2010, 03:09

Forum Jump:


Users browsing this thread: 1 Guest(s)