public static void sendinvite(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 || component.currentTeam != 0UL) || Interface.CallHook("OnTeamInvite", (object)basePlayer, (object)component) != null) { return; } team.SendInvite(component); }
public static void sendinvite(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 && component.currentTeam == 0) { if (Interface.CallHook("OnTeamInvite", basePlayer, component) != null) { return; } playerTeam.SendInvite(component); } } } }
void Invite(BasePlayer player, string targetPlayer) { string msgPlayerNotFound = lang.GetMessage("PlayerNotFound", this, player.UserIDString); // Used more than once // Check if player is in team if (player.currentTeam == 0UL) { player.ChatMessage(lang.GetMessage("NotInTeam", this, player.UserIDString)); return; } RelationshipManager.PlayerTeam aTeam = RelationshipManager.Instance.FindTeam(player.currentTeam); var aTarget = FindPlayersOnline(targetPlayer); // Check if player exists if (aTarget.Count <= 0) { player.ChatMessage(msgPlayerNotFound); return; } // Found Multiple players if (aTarget.Count > 1) { player.ChatMessage(string.Format("{0}: {1}", lang.GetMessage("MultiplePlayersFound", this, player.UserIDString), string.Join(", ", aTarget.ConvertAll(p => p.displayName).ToArray()))); return; } var theTarget = aTarget[0]; // Null Check if (theTarget == null) { player.ChatMessage(msgPlayerNotFound); return; } // Check if team leader if (aTeam.teamLeader != player.userID) { player.ChatMessage(lang.GetMessage("NotTeamLeader", this, player.UserIDString)); return; } // Check it target is player if (theTarget == player) { player.ChatMessage(lang.GetMessage("CannotInviteYourself", this, player.UserIDString)); return; } // Invite if all checks pass aTeam.SendInvite(theTarget); player.ChatMessage(string.Format("{0}: {1}", lang.GetMessage("Invited", this, player.UserIDString), theTarget.displayName)); }
public static void fakeinvite(ConsoleSystem.Arg arg) { BasePlayer player = arg.Player(); RelationshipManager.PlayerTeam team = RelationshipManager.Instance.FindTeam(arg.GetULong(0, 0UL)); if (team == null) { return; } if (player.currentTeam != 0UL) { Debug.Log((object)"already in team"); } team.SendInvite(player); Debug.Log((object)"sent bot invite"); }
public static void fakeinvite(ConsoleSystem.Arg arg) { BasePlayer basePlayer = arg.Player(); ulong num = arg.GetULong(0, (ulong)0); RelationshipManager.PlayerTeam playerTeam = RelationshipManager.Instance.FindTeam(num); if (playerTeam == null) { return; } if (basePlayer.currentTeam != 0) { Debug.Log("already in team"); } playerTeam.SendInvite(basePlayer); Debug.Log("sent bot invite"); }