Admins can disable/enable commands ingame.
#3

Here's how you can enable/disable a command in-game by typing /disablecmd rename disablecmd to whatever you want

Код:
new DisableCMD[MAX_PLAYERS];

CMD:disablecmd(playerid, params[])
{
	if (adlvl[playerid] < 5) return 0;
	if(DisableCMD == 1)
	{
		DisableCMD = 0;
		SendClientMessage(playerid, -1, "Command has been enabled.");
	}
	else
	{
		DisableCMD = 1;
		SendClientMessage(playerid, -1, "Command has been disabled.");
	}
	return 1;
}
use this in a command you want to be disabled
Код:
if(DisableCMD == 1) return SendClientMessage(playerid, COLOR_RED, "this command is disabled by admins.");
This only works for a single command though, to disable more commands you can make a new variable and command
for example:
Код:
new DisableCMD2[MAX_PLAYERS];

CMD:disablecmd2(playerid, params[])
{
	if (adlvl[playerid] < 5) return 0;
	if(DisableCMD2 == 1)
	{
		DisableCMD2 = 0;
		SendClientMessage(playerid, -1, "Command 2 has been enabled.");
	}
	else
	{
		DisableCMD2 = 1;
		SendClientMessage(playerid, -1, "Command 2 has been disabled.");
	}
	return 1;
}

if(DisableCMD2 == 1) return SendClientMessage(playerid, COLOR_RED, "this command is disabled by admins.");
Reply


Messages In This Thread
Admins can disable/enable commands ingame. - by KamalBakri - 05.06.2015, 20:01
Re: Admins can disable/enable commands ingame. - by Threshold - 05.06.2015, 20:38
Re: Admins can disable/enable commands ingame. - by Nubik - 05.06.2015, 21:02
Re: Admins can disable/enable commands ingame. - by KamalBakri - 05.06.2015, 21:06
Re: Admins can disable/enable commands ingame. - by JaydenJason - 05.06.2015, 22:10

Forum Jump:


Users browsing this thread: 1 Guest(s)