コード例 #1
0
ファイル: Config.cs プロジェクト: RoyIL/DPlugin
        public void SaveData(Transform transform, string[] permissions, IRocketPlayer caller)
        {
            var find = conf.Find(c => new Vector3 {
                x = c.transform.x, y = c.transform.y, z = c.transform.z
            } == transform.position);

            if (find == null)
            {
                conf.Add(new Data {
                    Permissions = new List <string>(permissions), transform = transform.position
                });
                Core.Insta.Configuration.Save();
            }
            else
            {
                RocketLib.UMessage(Core.Insta.Translations.Instance.Translate("AExsists"), caller);
            }
        }
コード例 #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);
                }
            }
        }