SA-MP Forums Archive
Block command(s) - 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)
+--- Thread: Block command(s) (/showthread.php?tid=422528)



Block command(s) - Ananisiki - 14.03.2013

^^^^^^^^


Re: Block command(s) - Glad2BeHere - 14.03.2013

Using ZCMD here u go
and a bool....
pawn Код:
new bool:commandsTog;


//example
CMD:togcmds(playerid, params[])
{
  // ad ur admin variables here such as IsPlayerAdmin or w/e ur using
  if(commandsTog == false)
  {
    commandsTog = true;
  }
  else
  {
   commandsTog = false ;
  }
  return 1;
}

//now in any command all u have to do is add this command somewhere @ the top of it
CMD:ah(playerid, params[])
{
  if(commandsTog == true) return SendClientMessage(playerid, -1, "Command is disabled");
  /*
     Coding w/e else u have suggest add somewhere at the top of the command so the cmd won't be
    executed... probably after the new's or something...
  */

  return 1;
}



Re: Block command(s) - Ananisiki - 14.03.2013

^^^^^^^^


Re: Block command(s) - Glad2BeHere - 14.03.2013

NB:Ensure This is at the top of the script [doesnt have to be top top just b4 the variable is ever called]
pawn Код:
bool:commandsTog;
//change to
new bool:commandsTog;



Re: Block command(s) - Ananisiki - 14.03.2013

^^^^^^^^