Minimum X, Maximum X
#1

Im not sure how to get Minimum X and Maximum X,
Well i know how but are MinimumX and MaximumX in the same place?
Or are there in 2 diffrent places, If so can someone tell me where minimumx is and where
maximumx is, ty
Reply
#2

Errr, they're not set places.. If you're talking about IsPlayerInArea, you start with a central point (/save) then you get your x-co-ordinate from the file. You then decide on a tolerance, and take away that from the x value. This is your minimum x. You then add the tolerance to the original x value, this is your maximum x value.

I am assuming that's what you're doing.
Reply
#3

I dont entirely get you
Reply
#4

What do you need the minimum/maximum x for?
Reply
#5

For IsPlayerInArea,
I dont know where to stand to get the MinimumX and Where to stand for the MaximumZ
Reply
#6

There are 2 ways of going about it. If you want to make a square area, the following method is probably best.

"Square Method"

Код:
 _______________
|       |
|       |
|       |
|    x   |
|       |
|       |
|______________|
Player stands at point x, in the center of the square they plan to make. You type /save, exit the game and open up your saved positions file.

You'll have something like this:

AddPlayerClass(0,9.0065,-2.7508,3.1172,335.5464,0,0,0,0,0,0);

By taking out this part, you have the X Y and Z. "9.0065,-2.7508,3.1172"

To work out your Minimum and maximum x from this, you need to know how wide you want your square. If you want a square 10 units wide, add and take away 5 from your X value:

Original:9.0065
Add 5: 14.0065 (Maximum x)
Take 5: 4.0065 (Minimum x)

You do the same for Y, and if you want the area to be a cube you do the Z aswell.

"Rectangle Method"

Код:
______________x
|       |   ^
|       |   |
x______________|   N
With this method you need to pay attention to which was is North so you get the right values in the right places.

Go to the top right corner of your area (north east) and /save. Then do the same for the south west corner.

Exit the game and get the values as mentioned above.

You'll have something like:

10.0, 100.0, 5.0 - South West
50.0, 120.0, 6.0 - North East

Minimum x = 10.0
Maximum x = 50.0
Minimum y = 100.0
Maximum y = 120.0

Using this method you don't have to know how many units your rectangle is across, and you'll map it out in game.

Hope these help.
Reply
#7

I think i can remember doing that and it didnt work, Let me try once more
Reply
#8

For the square method it's mainly trial and error, but if you want a precise sized box use the rectangle method.
Reply
#9

I think i can remember doing that and it didnt work, Let me try once more
Reply
#10

Well if it doesn't put the co-ordinates on here and I might be able to take a look. If I don't just PM me from my slumber.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)