Exemplo n.º 1
0
        private async void UnturnedPlayerEventsOnOnPlayerUpdateGesture(UnturnedPlayer player, UnturnedPlayerEvents.PlayerGesture gesture)
        {
            var cfg = Configuration.Instance;

            if (!cfg.UseGesture || !player.HasPermission(cfg.GesturePermission))
            {
                return;
            }

            if (gesture != UnturnedPlayerEvents.PlayerGesture.Point)
            {
                return;
            }

            var objTransform = RayCastUtil.GetComponent(player, cfg.Distance);
            var ownerInfo    = await objTransform.CheckOwner();

            if (ownerInfo == null)
            {
                UnturnedChat.Say(player, Translate("object_null"), Color.red);
                return;
            }

            UnturnedChat.Say(player, Translate("object_info", ownerInfo.Id, ownerInfo.Hp, ownerInfo.OwnerName + $"({ownerInfo.Owner})", ownerInfo.GroupName + $"({ownerInfo.Group})"), Color.magenta);
        }
Exemplo n.º 2
0
        public async void Execute(IRocketPlayer caller, string[] command)
        {
            var player       = (UnturnedPlayer)caller;
            var objTransform = RayCastUtil.GetComponent(player, Instance.Configuration.Instance.Distance);

            var ownerInfo = await objTransform.CheckOwner();

            if (ownerInfo == null)
            {
                UnturnedChat.Say(player, Instance.Translate("object_null"), Color.red);
                return;
            }

            UnturnedChat.Say(player, Instance.Translate("object_info", ownerInfo.Id, ownerInfo.Hp, ownerInfo.OwnerName + $"({ownerInfo.Owner})", ownerInfo.GroupName + $"({ownerInfo.Group})"), Color.magenta);
        }