What's new

Visual C# Problem z pobraniem danych

Neil

Advanced User
Joined
May 4, 2009
Messages
158
Reaction score
26
Witam, mam problem chcia?em ?eby w Visual C#, w formie by? stan HP ale mam b??d.. ?le to opisa?em ale w kodzie na pewno si? domy?licie o co mi chodzi.
mam takie using
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Timers;
using System.Windows.Forms;
using Tibia;
using Tibia.Objects;
using Tibia.Util;
using Tibia.Constants;
using Tibia.Packets;
using System.Net.Mail;
using System.Net.Sockets;
using System.Net;
using System.Media;
a to kod:
Code:
        private void label1_Click(object sender, EventArgs e)
        {
            Client client = Client.GetClients()[0];
            Player player = client.GetPlayer();
            int hp = player.HP;
            MessageBox.Show("Stan HP: " + hp);
        }
i jak klikn? w Label, to zamiast Stan HP: 123, pisze mi: "Stan HP: x"
jak nacisn? F6 wyskakuje mi taki b??d:
Code:
Error	1	'Tibia.Objects.Player' does not contain a definition for 'HP' and no extension method 'HP' accepting a first argument of type 'Tibia.Objects.Player' could be found (are you missing a using directive or an assembly reference?)	C:\Users\Acodin\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.cs	35	29	WindowsFormsApplication1
oraz podkre?la int hp = player.HP;
#down: dalej nie dzia?a ;/
 

karkucik

Active User
Joined
Apr 26, 2008
Messages
146
Reaction score
9
Age
32
Odp: Visual C# Problem z pobraniem danych

Nie powinno by? przypadkiem
Code:
player.Health
?
Masz dokumentacj?, masz intelisense, nie musisz zgadywa? nazw metod i p?l.
 
Top