deactivate command - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: deactivate command (
/showthread.php?tid=113582)
deactivate command -
TouR - 14.12.2009
is there a way an admin using rcon deactivate a command like /dm
Re: deactivate command -
Andy_McKinley - 14.12.2009
I don't think you can do it with (default) RCON commands.
Re: deactivate command -
TouR - 14.12.2009
ok thank you for your help
Re: deactivate command -
Martin_M - 14.12.2009
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.");
Re: deactivate command -
Mike Garber - 16.12.2009
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.
Re: deactivate command -
CaHbKo - 16.12.2009
Код:
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.