deactivate command
#1

is there a way an admin using rcon deactivate a command like /dm
Reply
#2

I don't think you can do it with (default) RCON commands.
Reply
#3

ok thank you for your help
Reply
#4

You can create some command like /disabledm and check who uses this command by a:
Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not RCON admin.");
Reply
#5

Quote:
Originally Posted by Martin_M
You can create some command like /disabledm and check who uses this command by a:
Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not RCON admin.");
That's not what he's asking.
Reply
#6

Код:
new DmEnabled = 1;

	//insert in OnPlayerCommandText
	new cmd[256];
	new idx;
	cmd = strtok(cmdtext, idx);
	if(strcmp(cmd, "/dm", true) == 0)
	{
		if(DmEnabled)
		{
			//dm code
		}
		else
		{
			SendClientMessage(playerid, COLOR_WHITE, "DM is disabled by an admin.");
		}
	}
	if(strcmp(cmd, "/togdm", true) == 0)
	{
		if(IsPlayerAdmin(playerid))
		{
			if(DmEnabled)
			{
				DmEnabled = 0;
				SendClientMessageToAll(COLOR_WHITE, "DM is disabled now.");
			}
			else
			{
				DmEnabled = 1;
				SendClientMessageToAll(COLOR_WHITE, "DM is enabled now.");
			}
		}
	}
Try this.

PS. I added those "new cmd[256]" and etc. because it might not work for you without those. It's like i have in my script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)