예제 #1
0
        private static bool SwitchCamera(Scp079PlayerScript __instance, ushort camId, bool lookatRotation)
        {
            try
            {
                var    camera   = Server.Get.Map.Cameras.Find(cam => cam.ID == camId);
                Player player   = __instance.GetPlayer();
                bool   spawning = false;
                if (!player.Scp079Controller.Spawned)
                {
                    spawning = true;
                    player.Scp079Controller.Spawned = true;
                }

                SynapseController.Server.Events.Scp.Scp079.Invoke079CameraSwitch(
                    __instance.gameObject.GetPlayer(),
                    camera,
                    lookatRotation,
                    spawning,
                    out var allowed
                    );

                return(allowed);
            }
            catch (Exception e)
            {
                Synapse.Api.Logger.Get.Error($"Synapse-Event: Scp079CameraSwitchEvent failed!!\n{e}");
                return(true);
            }
        }
예제 #2
0
 public static bool Prefix(Scp079PlayerScript __instance, ref int newLvl)
 {
     try
     {
         bool allow = true;
         Events.InvokeScp079LvlEvent(__instance.GetPlayer(), ref newLvl, ref allow);
         return(allow);
     }
     catch (Exception e)
     {
         Log.Error($"Scp079GainLevelEvent Error: {e}");
         return(true);
     }
 }