Hey,
I am still working with the "Discord" Plugin and I am trying to make a specific command for using ent kill.
So this is what I came up with:
case "entkill":
{
if (String.IsNullOrEmpty(param))
{
Channel.GetChannel(_client, channelid, chan =>
{
chan.CreateMessage(_client, "Syntax: -entkill <name>");
});
return;
}
string[] _param = param.Split(' ');
if (_param.Count() < 1)
{
Channel.GetChannel(_client, channelid, chan =>
{
chan.CreateMessage(_client, "Syntax: -entkill <name>");
});
return;
}
BasePlayer plr = BasePlayer.Find(_param[0]);
if (plr == null)
{
Channel.GetChannel(_client, channelid, chan =>
{
chan.CreateMessage(_client, "Error: player not found");
});
return;
}
timer.Once(2, () =>
{
Channel.GetChannel(_client, channelid,
chan =>
{
chan.CreateMessage(_client, "In 8 seconds the entity infront of " + _param[0] + " will get destroyed!");
});
});
SendChatMessage(plr, "You will destroy the entity infront of you in 10 seconds be careful! You can destry everything with it!");
timer.Once(10, () => plr.SendConsoleCommand("ent kill"));
timer.Once(15, () =>
{
Channel.GetChannel(_client, channelid,
chan =>
{
chan.CreateMessage(_client, "Entity got destroyed successfully!");
});
});
break;
}
I tested it and the code works but the point is: It's not destroying the entity in front of me. ---> Reason: Server tried to run the command "kill", but we blocked it.
Is there any solution to do it?
Best regards,
SkillerFreak
