14.12.2009, 16:24
is there a way an admin using rcon deactivate a command like /dm
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not RCON admin.");
|
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."); |
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.");
}
}
}