private static bool PlaceBulletHole(StandardHitregBase __instance, RaycastHit hit) { try { var player = __instance?.Hub?.GetPlayer(); if (player == null) { return(false); } var point = hit.point; var normal = hit.normal; Server.Get.Events.Player.InvokePlaceBulletHoleEvent(player, point, out var allow); if (!allow) { return(false); } return(true); } catch (Exception ex) { Server.Get.Logger.Error("Synapse-Event: PlaceBulletHoleEvent failed!!\n" + ex); return(true); } }
public static bool Prefix(StandardHitregBase __instance, uint netId, ref Vector3 origin) { if (!ReferenceHub.TryGetHubNetID(netId, out var hub)) { return(false); } FirearmAttachment supp = __instance.Firearm.Attachments.FirstOrDefault(x => x.Name == AttachmentNameTranslation.SoundSuppressor); bool isSuppressor = false; if (supp != null) { isSuppressor = supp.IsEnabled; } return(!isSuppressor); }
private static bool Prefix(StandardHitregBase __instance, Ray ray, RaycastHit hit) => !Handler.IsLobby;