public static void addtoteam(ConsoleSystem.Arg arg) { RaycastHit raycastHit; BasePlayer basePlayer = arg.Player(); RelationshipManager.PlayerTeam playerTeam = RelationshipManager.Instance.FindTeam(basePlayer.currentTeam); if (playerTeam == null) { return; } if (playerTeam.GetLeader() == null) { return; } if (playerTeam.GetLeader() != basePlayer) { return; } if (Physics.Raycast(basePlayer.eyes.position, basePlayer.eyes.HeadForward(), out raycastHit, 5f, 1218652417, QueryTriggerInteraction.Ignore)) { BaseEntity entity = raycastHit.GetEntity(); if (entity) { BasePlayer component = entity.GetComponent <BasePlayer>(); if (component && component != basePlayer && !component.IsNpc) { playerTeam.AddPlayer(component); } } } }
public static void addtoteam(ConsoleSystem.Arg arg) { BasePlayer basePlayer = arg.Player(); RelationshipManager.PlayerTeam team = RelationshipManager.Instance.FindTeam(basePlayer.currentTeam); RaycastHit hit; if (team == null || Object.op_Equality((Object)team.GetLeader(), (Object)null) || (Object.op_Inequality((Object)team.GetLeader(), (Object)basePlayer) || !Physics.Raycast(basePlayer.eyes.position, basePlayer.eyes.HeadForward(), ref hit, 5f, 1218652417, (QueryTriggerInteraction)1))) { return; } BaseEntity entity = hit.GetEntity(); if (!Object.op_Implicit((Object)entity)) { return; } BasePlayer component = (BasePlayer)((Component)entity).GetComponent <BasePlayer>(); if (!Object.op_Implicit((Object)component) || !Object.op_Inequality((Object)component, (Object)basePlayer) || component.IsNpc) { return; } team.AddPlayer(component); }
public static void kickmember(ConsoleSystem.Arg arg) { BasePlayer basePlayer = arg.Player(); if (basePlayer == null) { return; } RelationshipManager.PlayerTeam playerTeam = RelationshipManager.Instance.FindTeam(basePlayer.currentTeam); if (playerTeam == null) { return; } if (playerTeam.GetLeader() != basePlayer) { return; } ulong num = arg.GetULong(0, (ulong)0); if (basePlayer.userID == num) { return; } if (Interface.CallHook("OnTeamKick", playerTeam, basePlayer) != null) { return; } playerTeam.RemovePlayer(num); }
public static void kickmember(ConsoleSystem.Arg arg) { BasePlayer basePlayer = arg.Player(); if (Object.op_Equality((Object)basePlayer, (Object)null)) { return; } RelationshipManager.PlayerTeam team = RelationshipManager.Instance.FindTeam(basePlayer.currentTeam); if (team == null || Object.op_Inequality((Object)team.GetLeader(), (Object)basePlayer)) { return; } ulong playerID = arg.GetULong(0, 0UL); if ((long)basePlayer.userID == (long)playerID || Interface.CallHook("OnTeamKick", (object)team, (object)basePlayer) != null) { return; } team.RemovePlayer(playerID); }
private void OnTeamDisbanded(RelationshipManager.PlayerTeam team) => KeyType(team.GetLeader(), "OnTeamDisbanded", team.teamID, team.GetLeader().displayName, team.GetLeader().userID);
private void OnTeamRejectInvite(BasePlayer rejector, RelationshipManager.PlayerTeam team) => KeyType(rejector, "OnTeamRejectInvite", team.teamID, rejector.displayName, rejector.userID, team.GetLeader());
private void OnTeamAcceptInvite(RelationshipManager.PlayerTeam team, BasePlayer player) => KeyType(player, "OnTeamAcceptInvite", team.teamID, player.displayName, player.userID, team.GetLeader().displayName);