Restrict commands - 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: Restrict commands (
/showthread.php?tid=426143)
Restrict commands -
Ananisiki - 28.03.2013
^^^^^^^^
Re: Restrict commands -
Ananisiki - 28.03.2013
^^^^^^^^
Re: Restrict commands -
SKAzini - 28.03.2013
Make a boolean which is disabled by default. Set the boolean to true on /restrictrape and make it so it checks if the boolean is true and then return that the command is restricted.
pawn Код:
new bool:RestrictRape;
CMD:restrictrape(playerid, params[])
{
if(admin)
{
if(RestrictRape)
{
RestrictRape = false;
SendClientMessageToAll(-1, "Rape has been un-restricted by an admin.");
}
else
{
RestrictRape = true;
SendClientMessageToAll(-1, "Rape has been restricted by an admin.");
}
}
}
CMD:rape(playerid, params[])
{
if(RestrictRape) return SendClientMessageToAll(-1, "Rape is restricted.");
//your code here..
}
Re: Restrict commands -
Ananisiki - 28.03.2013
^^^^^^^^
Re: Restrict commands -
SKAzini - 28.03.2013
If you take some effort in understanding the code you will be able to do that yourself.