1
Tutorials / Re: [PI] Teleport Everyone to X and Y pos
« on: March 12, 2011, 04:04:09 pm »Code: [Select]int xpos = Integer.parseInt(arg[1]);
int ypos = Integer.parseInt(arg[2]);
for (int j = 0; j < Server.playerHandler.players.length; j++) {
1. xPos.
2. integer.parseInt
3. PlayerHandler.players.length; j++) {
Why?
1. Methods are always started with lowercase.
2. integer = 1 integerSomeThing = 2 (lower to upper)
3. Useless code, make it cleaned by just using PlayerHandler since you've surely got server imported in top of
4. You might be thinking, this guy says methods must start with lower case (conventions) why is playerHandler turned into PlayerHandler, well PlayerHandler is a class.
that class.
Good job though,
Works fine.
What are you saying?
Code: [Select]
xPosThat is a variable... you can declare it what ever you want.
Also,
Code: [Select]
Integer.parseIntHowever if that is the case, it's suppose to be Integer. He is extending to the Integer class (hence class, it's NOT a method).
