namespace Oxide.Plugins { [Info("Limit Bed Assigning to Team", "bsdinis", "0.0.2")] [Description("Limits bed assigning to team members only.")] public class LimitBedAssigningToTeam : RustPlugin { private object CanAssignBed(BasePlayer player, SleepingBag bag, ulong targetPlayerId) { if (player == null || bag == null) return null; if (player.currentTeam == 0) { player.ChatMessage($"You must create a team to be able to assign beds."); return false; } if (BasePlayer.FindAwakeOrSleeping(targetPlayerId.ToString()) == null || player.currentTeam != BasePlayer.FindAwakeOrSleeping(targetPlayerId.ToString()).currentTeam) { player.ChatMessage("You can only assign beds to team members."); return false; } if (player.currentTeam == BasePlayer.FindAwakeOrSleeping(targetPlayerId.ToString()).currentTeam) return null; if (RelationshipManager.ServerInstance.FindTeam(player.currentTeam).members.Count >= RelationshipManager.maxTeamSize) { player.ChatMessage($"You are exceeding the group limit on this server.\nYou must kick a player from your current team to be able to assign a bed."); return false; } return null; } } }