Current time: 06-28-2017, 10:07 AM Hello There, Guest! (LoginRegister)


Post Reply 
Programming/plugin chat
07-29-2013, 04:46 PM
Post: #1
Programming/plugin chat
This is an area to chat about programming and plugins!
I made this thread because, believe it or not(Alex certainly didn't), I program! I am new to it and sometimes need help. So lets get the dice rolling...

Pak's Motto:
We fight for pay.
We fight for our beliefs.
We fight for our KFC!
Chuck Norris doesn't win, he just allows you to lose.
Visit this user's website Find all posts by this user
Quote this message in a reply
07-29-2013, 04:50 PM
Post: #2
RE: Programming/plugin chat
#Sweg doh
Find all posts by this user
Quote this message in a reply
07-29-2013, 05:59 PM
Post: #3
RE: Programming/plugin chat
system.out.println(We will never reveal our secrets.)
Visit this user's website Find all posts by this user
Quote this message in a reply
07-29-2013, 06:02 PM
Post: #4
RE: Programming/plugin chat
this.getServer.broadcastMessage(ChatColor.RAINBOW + "Trollolololol" )

[Image: 2h33qxy.jpg]
[Image: Xegaming+donorplus+userbar.png]
[Image: 214ziut.jpg]
[Image: OSSPH.gif]

MattyJ1707
Find all posts by this user
Quote this message in a reply
07-29-2013, 08:49 PM (This post was last modified: 07-29-2013 08:50 PM by NobodyCares.)
Post: #5
RE: Programming/plugin chat
lol, both of you messed up.

MrMineManCraft, it's case sensitive, capital "S".

Matty, getServer is a method not a field, therefore needs parameters. this.getServer()
Find all posts by this user
Quote this message in a reply
07-29-2013, 11:08 PM
Post: #6
RE: Programming/plugin chat
It wasnt case sensitive when I learned.
Visit this user's website Find all posts by this user
Quote this message in a reply
07-29-2013, 11:58 PM
Post: #7
RE: Programming/plugin chat
Then you learned wrong, lol.
Find all posts by this user
Quote this message in a reply
07-30-2013, 03:35 AM
Post: #8
RE: Programming/plugin chat
(07-29-2013 08:49 PM)NobodyCares Wrote:  lol, both of you messed up.

MrMineManCraft, it's case sensitive, capital "S".

Matty, getServer is a method not a field, therefore needs parameters. this.getServer()

There is also no ChatColor.RAINBOW, I made that up Tongue It's amazing how much I just scroll down the methods on eclipse and press enter. It makes it hard to type them out without it Tongue

[Image: 2h33qxy.jpg]
[Image: Xegaming+donorplus+userbar.png]
[Image: 214ziut.jpg]
[Image: OSSPH.gif]

MattyJ1707
Find all posts by this user
Quote this message in a reply
07-30-2013, 07:22 AM (This post was last modified: 07-30-2013 07:32 AM by bobdabiulder.)
Post: #9
RE: Programming/plugin chat
Lol I don't have my laptop here since I'm on my iPad so I can't spew out lines of code. But I can do this
player.sendMessage("Hi!")

Or
player.sendMessage("Hi, " +player);
But you will need to do Player player = new Player or something like that first. YOLO

Pak's Motto:
We fight for pay.
We fight for our beliefs.
We fight for our KFC!
Chuck Norris doesn't win, he just allows you to lose.
Visit this user's website Find all posts by this user
Quote this message in a reply
07-30-2013, 11:55 AM
Post: #10
RE: Programming/plugin chat
(07-30-2013 07:22 AM)bobdabiulder Wrote:  Lol I don't have my laptop here since I'm on my iPad so I can't spew out lines of code. But I can do this
player.sendMessage("Hi!")

Or
player.sendMessage("Hi, " +player);
But you will need to do Player player = new Player or something like that first. YOLO

Player p = (Player) sender;
p.sendMessage(ChatColor.DARK_RED + "Hi " + p.getName());

The space after "hi" is important otherwise it would be HiMattyJ1707. This also assumes that it is on command with the usual
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
return true;
}

If it was in an event, for example a PlayerLoginEvent, it would be:

public void onPlayerLogin(PlayerLoginEvent event) {
Player p = event.getPlayer;
p.sendMessage(ChatColor.DARK_RED + "hi " + p.getName());
}

Typed out on an iPod.

[Image: 2h33qxy.jpg]
[Image: Xegaming+donorplus+userbar.png]
[Image: 214ziut.jpg]
[Image: OSSPH.gif]

MattyJ1707
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)