コード例 #1
0
ファイル: Chat.cs プロジェクト: tracid56/WiredPlayers-RP
        public void AmeCommand(Client player, string message = "")
        {
            if (player.HasData(EntityData.PLAYER_AME) == true)
            {
                // We get player's TextLabel
                TextLabel label = player.GetData(EntityData.PLAYER_AME);

                if (message.Length > 0)
                {
                    // We update label's text
                    label.Text = "*" + message + "*";
                }
                else
                {
                    // Deleting TextLabel
                    label.Detach();
                    label.Delete();
                    player.ResetData(EntityData.PLAYER_AME);
                }
            }
            else
            {
                TextLabel ameLabel = NAPI.TextLabel.CreateTextLabel("*" + message + "*", new Vector3(0.0f, 0.0f, 0.0f), 50.0f, 0.5f, 4, new Color(201, 90, 0, 255));
                ameLabel.AttachTo(player, "SKEL_Head", new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0.0f, 0.0f, 0.0f));
                player.SetData(EntityData.PLAYER_AME, ameLabel);
            }
        }
コード例 #2
0
        public Description(AccountEntity player)
        {
            DescriptionLabel = NAPI.TextLabel.CreateTextLabel("", player.Client.Position, 10f, 1f, 1, new Color(255, 255, 255), true,
                                                              player.Client.Dimension);

            DescriptionLabel.Color         = new Color(192, 192, 192);
            DescriptionLabel.Collisionless = true;
            DescriptionLabel.Seethrough    = true;
            DescriptionLabel.Invincible    = true;
            DescriptionLabel.Transparency  = 250;
            DescriptionLabel.AttachTo(player.Client, "SKEL_ROOT", new Vector3(50f, 1f, 1f), player.Client.Rotation);

            //Jak gracz zmieni wymiar to żeby miał opis np. jak wejdzie do interioru
            //to zmieniamy wymiar temu labelowi opisu

            player.CharacterEntity.OnPlayerDimensionChanged += (e, args) =>
            {
                NAPI.Entity.SetEntityDimension(DescriptionLabel.Handle, args.CurrentDimension);
            };
        }