deactivate command
#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


Messages In This Thread
deactivate command - by TouR - 14.12.2009, 16:24
Re: deactivate command - by Andy_McKinley - 14.12.2009, 16:27
Re: deactivate command - by TouR - 14.12.2009, 16:27
Re: deactivate command - by Martin_M - 14.12.2009, 16:38
Re: deactivate command - by Mike Garber - 16.12.2009, 10:09
Re: deactivate command - by CaHbKo - 16.12.2009, 10:44

Forum Jump:


Users browsing this thread: 1 Guest(s)