예제 #1
0
파일: Core.cs 프로젝트: RoyIL/DPlugin
        public static void DeleteData(Transform transform, string[] permissions, IRocketPlayer rocketPlayer)
        {
            var i = Insta.Configuration.Instance.conf.FindIndex(c => new Vector3 {
                x = c.transform.x, y = c.transform.y, z = c.transform.z
            } == RocketLib.Raycast(rocketPlayer).transform.position);

            Insta.Configuration.Instance.conf.RemoveAt(i);
            Insta.Configuration.Save();
        }
예제 #2
0
파일: Core.cs 프로젝트: RoyIL/DPlugin
        public static void Main(IRocketPlayer caller)
        {
            var RaycastPos = RocketLib.Raycast(caller).transform.position;
            var Exsists    = Insta.Configuration.Instance.conf.Exists(c => new Vector3 {
                x = c.transform.x, y = c.transform.y, z = c.transform.z
            } == RaycastPos);

            if (Exsists != false)
            {
                var Item = Insta.Configuration.Instance.conf.Find(c => new Vector3 {
                    x = c.transform.x, y = c.transform.y, z = c.transform.z
                } == RaycastPos);
                if (CheckPerms(caller, Item.Permissions))
                {
                    RocketLib.OpenDoor(RocketLib.Raycast(caller), ShouldOpen(RocketLib.RaycastForDoorOnly(caller)));
                }
                else
                {
                    RocketLib.UMessage(Insta.Translations.Instance.Translate("NoPerms"), caller);
                }
            }
        }
예제 #3
0
파일: Core.cs 프로젝트: RoyIL/DPlugin
 private void UnturnedPlayerEvents_OnPlayerUpdateGesture(UnturnedPlayer player, Rocket.Unturned.Events.UnturnedPlayerEvents.PlayerGesture gesture)
 {
     if (gesture.Equals(Rocket.Unturned.Events.UnturnedPlayerEvents.PlayerGesture.PunchLeft) && RocketLib.Raycast(player) != null)
     {
         Main(player);
     }
 }