using System.Collections.Generic; namespace Oxide.Plugins { [Info("Tugboat PVP", "nivex, RustyMike", "0.1.0")] [Description("Enable PVP while onboard a Tugboat.")] public class TugboatPVP : RustPlugin { private List boatPlayers = new List(); private object CanEntityTakeDamage(BasePlayer player, HitInfo info) => player != null && boatPlayers.Contains(player.userID) ? true : (object)null; private void OnEntityEnter(TriggerParent trigger, BasePlayer player) { if (trigger == null || player == null || player.IsNpc || !player.userID.IsSteamId()) { return; } if (trigger.gameObject.transform.root.name == "assets/content/vehicles/boats/tugboat/tugboat.prefab") { player.ChatMessage("Entering PVP zone"); boatPlayers.Add(player.userID); } } private void OnEntityLeave(TriggerParent trigger, BasePlayer player) { if (trigger == null || player == null || player.IsNpc || !player.userID.IsSteamId()) { return; } if (trigger.gameObject.transform.root.name == "assets/content/vehicles/boats/tugboat/tugboat.prefab") { player.ChatMessage("Leaving PVP zone"); boatPlayers.Remove(player.userID); } } } }