RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Player position

_Epila_

Sorceror
Player position

is there any way to get the client position in the Map ?
to create a Map tracking


(sorry if i post in wront place)
 

JesuZ

Wanderer
Sorry for my stupidity, but I don't actually get how that Client.FindLocation() works...?
What variabes should I give for it, or does it just return something...?

Yeah, just begining with this kind of stuff... :)


Edit:
Okey... After little googleing...
Got how ref variables works, and here's finally my code for character position:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Ultima;


namespace UORadar
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Ultima.Client.Calibrate();

int CharX;
int CharY;
int CharZ;
int CharF;
CharX = 0;
CharY = 0;
CharZ = 0;
CharF = 0;
Ultima.Client.FindLocation(ref CharX, ref CharY, ref CharZ, ref CharF);
Bitmap radarmap = Ultima.Map.Felucca.GetImage(CharX / 8, CharY / 8, 100, 100);
pictureBox1.Image = radarmap;
xpos.Text = Convert.ToString(CharX);
ypos.Text = Convert.ToString(CharY);
}

private void button1_Click(object sender, EventArgs e)
{
string viesti = ": " + msg.Text;
Client.SendText(viesti);
}
}
}

Something like that :)
 
Top