Sign in to follow this  
Eject

message TO the player that loged in

Recommended Posts

Hello friends of wurm

 

here i speak about the announcer mod and would need some little help ;)

 

 

With this all other players get an info if a new player is loging in

MessageServer.broadCastSafe("Spieler " + player.getName() + " hat sich eingeloggt.", (byte) 1);

Now i like to know, how i can send a announce at the same time to the new loged in Player, like "Welcome playername"?

Next is, i read about you can change the textcolor with html tags in java, how would this work or is there another option?

Last but not least, have you a little hint for me, how i can announce a text from a properties file? i tried that but it seems not working for me atm ^^

 

Eject

Edited by Eject

Share this post


Link to post
Share on other sites

with the message from the propertiesfile i get always a little error, maybe a very little ^^

 

in porperties i added: announceMessage="This is a test"

 

in the classfile i added:

 

at public class

boolean announceMessage;

at configure method:

this.announceMessage = Boolean.valueOf(properties.getProperty("announceMessage", String.valueOf(this.announceMessage))).booleanValue();

and at the output under the other message

MessageServer.broadCastSafe(this.announceMessage + ".", (byte) 1);

 

Server is starting but with the one client i see something like this:

 

Player Eject has logged in

False

 

where is the issue? ^^

 

Eject

 

edit: ok i forget =true at the boolean but still the same issue

 

announceMessage="blah blah" dont work

announceMessage=bla blah also dont work ^^

Edited by Eject

Share this post


Link to post
Share on other sites

Thank you it works now =)

...and i had to use the toString method

 

this.announceMessage = String.valueOf(properties.getProperty("announceMessage", String.valueOf(this.announceMessage))).toString();

.

.

 

MessageServer.broadCastSafe("..." + announceMessage + "...", (byte) 1);

Edit: for reading the text from the properties file

Eject

Edited by Eject
  • Like 1

Share this post


Link to post
Share on other sites

this works too (sending text to the event window if a player logged in)...bad i cant figure out how to send it via broadcast just to the player, but ok....the message would be shown for a too short time, not good if you announce ts3 ip and website

 

player.getCommunicator().sendNormalServerMessage(  "" + announceMessage + "", (byte) 1);

Eject

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this