SA-MP Forums Archive
Disabling 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: Disabling Commands (/showthread.php?tid=329792)



Disabling Commands - spd_sahil - 30.03.2012

if i disable commands in one filterscript , will the change take place for all filterscripts ??

as in ..

if i disable commands from filterscript 1 , and filterscript 2 also have some commands will they get disabled as well ? if not then how am i supposed to go about this ?


Re: Disabling Commands - Shabi RoxX - 30.03.2012

Disable you mean remove ? if your all FS's have same cmd ? than you to remove them all.....


Re: Disabling Commands - spd_sahil - 30.03.2012

disable as in , not able to use ingame , for a certain period of time , for example while in a minigame


Re: Disabling Commands - Reklez - 30.03.2012

Your filterscript use OnPlayerCommandText or ZCMD system?


Re: Disabling Commands - spd_sahil - 30.03.2012

dcmd


Re: Disabling Commands - Smally - 30.03.2012

You could create a variable like
pawn Код:
if(pVariables[playerid][pGame] == 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command while in an minigame.");



Re: Disabling Commands - spd_sahil - 30.03.2012

Quote:
Originally Posted by Lido
Посмотреть сообщение
You could create a variable like
pawn Код:
if(pVariables[playerid][pGame] == 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command while in an minigame.");
but will this disable use of commands which are there in other filterscripts ?


Re: Disabling Commands - Smally - 30.03.2012

You could have to put this in every command you want to disable, could you please show me an example of a command you are trying to disable, also how does your gamemode load/save data? Aswell as the command that they enter, a minigame, and last could I have your player variables.


Re: Disabling Commands - Reklez - 30.03.2012

@Lido theres other way to make it more easier like this

pawn Код:
new DisableCMD[MAX_PLAYERS];

//OnPlayerCommandText (Also put this on Filterscript that you want to disable a command)

if(DisableCMD[playerid] == 1) return //you want to do to players attempting to use command
//^^^ add this at after the '{' brackets of OnPlayerCommandText

//Commands MiniGame

DisableCMD[playerid] = 1;

//Commands leave

DisableCMD[playerid] = 0;