Please, prevent players from being able to fly into dueling zone with flying vehicle. Something similar to raid base protection would be great.
Prevent fly into dueling zone with flying vehicleSolved
sure, try it out. https://pastebin.com/TLXkNNK3
Nope. Still able to fly into zone. Removed existing zone to test and created new one automaticly.
Also still blocking commands server-wide, 'coz you are not checking for player is in duel in OnUserCommand hook. And you still blocking them silently, that's bad, 'coz player can't understand what's happening. He is typing command and just nothing happens. Please, add a message, like I suggested.
Also still blocking commands server-wide, 'coz you are not checking for player is in duel in OnUserCommand hook. And you still blocking them silently, that's bad, 'coz player can't understand what's happening. He is typing command and just nothing happens. Please, add a message, like I suggested.
object OnUserCommand(IPlayer p, string command)
{
BasePlayer player = p.Object as BasePlayer;
if (!init || !player.IsValid() || player.transform == null || !DuelTerritory(player.transform.position))
{
return null;
}
if (player.IsValid())
{
if (useBlacklistCommands && blacklistCommands.Any(entry => entry.TrimStart('/').Equals(command, StringComparison.OrdinalIgnoreCase)))
{
player.ChatMessage(msg("CommandNotAllowed", player.UserIDString));
return true;
}
if (useWhitelistCommands && !whitelistCommands.Any(entry => entry.TrimStart('/').Equals(command, StringComparison.OrdinalIgnoreCase)))
{
player.ChatMessage(msg("CommandNotAllowed", player.UserIDString));
return true;
}
}
return null;
} did you look to see why it isn't working?
and please keep the other issue in its own thread. I already replied saying it's added in next update :p
and please keep the other issue in its own thread. I already replied saying it's added in next update :p
Well, the version you gave link to was with some changes of commands, and moved prefix also, so I thought it was a "fixed version". So decided to make sure it will not be "half-way-fixed".
I'm not sure how it should work. Maybe you can add some debug and I will do some tests.
I'm not sure how it should work. Maybe you can add some debug and I will do some tests.
private void OnTriggerEnter(Collider col)
{
var m = col?.ToBaseEntity() as BaseMountable;
if (m.IsValid())
{
EjectMountable(m);
}
}can just look here to see if its called or not
I was testing like this
Merged post
No prints.
private void EjectMountable(BaseMountable m)
{
ins.Puts("EjectMountable: 1");
var position = ((m.transform.position.XZ3D() - _zonePos.XZ3D()).normalized * (zoneRadius + 10f)) + _zonePos; // credits k1lly0u
float y = TerrainMeta.HighestPoint.y + 250f;
RaycastHit hit;
if (Physics.Raycast(position + new Vector3(0f, y, 0f), Vector3.down, out hit, position.y + y + 1f, targetLayer, QueryTriggerInteraction.Ignore))
{
ins.Puts("EjectMountable: 2");
position.y = hit.point.y;
}
else position.y = GetSpawnHeight(position);
ins.Puts("EjectMountable: 3");
if (m.transform.position.y > position.y)
{
ins.Puts("EjectMountable: 4");
position.y = m.transform.position.y;
}
if (m is MiniCopter)
{
ins.Puts("EjectMountable: 5");
m.transform.position = position;
}
else m.transform.position = m.mountAnchor.transform.position = position;
ins.Puts("EjectMountable: 6");
m.TransformChanged();
}Just to start with something. There were no prints. Later today I will test like this
private void OnTriggerEnter(Collider col)
{
ins.Puts("OnTriggerEnter: 1");
var m = col?.ToBaseEntity() as BaseMountable;
ins.Puts(m.ShortPrefabName);
if (m.IsValid())
{
ins.Puts("OnTriggerEnter: m.IsValid()");
EjectMountable(m);
}
}Merged post
No prints.
Added in 1.2.6
Locked automatically