using System; using System.Linq; using Oxide.Core; using Oxide.Core.Plugins; #region Changelogs and ToDo /********************************************************************** * * 1.0.0 : - Initial release * **********************************************************************/ #endregion namespace Oxide.Plugins { [Info("FrankiesFriendlyFire", "Krungh Crow", "1.0.0")] [Description("Nulls the damage Frankie gets from his owner")] class FrankiesFriendlyFire : RustPlugin { #region Variables const string Use_Perm = "frankiesfriendlyfire.use"; #endregion #region Hooks void Init() { permission.RegisterPermission(Use_Perm, this); } void OnEntityTakeDamage(BasePet frankie, HitInfo info) { if (frankie == null || info.InitiatorPlayer == null) return; if (!info.InitiatorPlayer.userID.IsSteamId()) return; BasePlayer player = info.InitiatorPlayer; var _playerid = player.UserIDString.ToString(); var _frankieid = frankie.OwnerID.ToString(); if (_frankieid == _playerid && permission.UserHasPermission(player.UserIDString, Use_Perm)) { info.damageTypes.ScaleAll(0); } return; } #endregion } }