good job, thx![]()
|
|
Purpose: So you'll be teled back to where you where before you started the random.
Difficulty: Aslong as you know what an int is, we'll be ok.
Works On: Untested, should work on all. If you want it to be 100%, you need to make the myCoordX and myCoordY to save in character file, otherwise it'll be lost if they logout or something. I'll post an improved version.
I'm not going to spoonfeed, I got a random on rs and how it worked ran through my mind for some odd reason.
declare these
add this methodCode:public int myCoordX = 0000; public int myCoordY = 0000;
At the begining of your random, before he teles you away, add this.Code:public void saveMyCoords() { myCoordX = absX; myCoordY = absY; }
at the end, when you've done what your supposed to.Code:saveMyCoords();
Code:toX = myCoordX; toY = myCoordY;
If you get an error that says
Cannot Find Symbol, and it points to toX or toY, and you don't know how to figure it out, just give up, you shouldn't even be looking on this site.

Nice, and this also can be used for other things then random...
cant think of any but im sure there is something![]()
If you logout, or server restarts, co-ords are gone. Might be better just to save them in the char file, or no point.

Whoa, actually a nice code.![]()
Thanks guys, I would have added how to save the coords but basically, I didn't want alot of noobs using it.
I might edit it in.

lol?
Why not = 0? If you think you need it to save to a certain number of digits you are wrong, the int will save whatever value you tell it to as long as it is a valid integer.Code:public int myCoordX = 0000; public int myCoordY = 0000;
I already knew that, I don't know why, I'm just a neat freak.
| « Farming My Way. [With Pictures] | Staff Metting Command TuT » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |