HI MR DUNE
PUSSY!
|
Purpose: To add in a Advertisement Message
(Yes i know Gander posted one on Runesoft, But i see that one is gone, And so now i thought i would post a new one.)
Step 1:
Search for this in client.java:
Step 2:Code:public class client extends Player implements Runnable {
Underneath that, add this:
Step 3:Code:public void advertise(){ //This is the advertising method if (misc.random(1500) == 1){ //Edit the (1500) to change the time of the message PlayerHandler.messageToAll = ("PUT YOUR MESSAGE HERE"); //This yells the message out } }
Search for:
OrCode:public boolean process()
Step 4:Code:public void process()
Underneath that add this:
And your done.Code:advertise(); //This calls the advertising method
HI MR DUNE
PUSSY!
You can do it a more simple way with a better outcome
toCode:public void advertise(){ //This is the advertising method if (misc.random(1500) == 1){ //Edit the (1500) to change the time of the message PlayerHandler.messageToAll = ("PUT YOUR MESSAGE HERE"); //This yells the message out } }
But a better way is to do your way but use more than one thingCode:public void advertise(){ //This is the advertising method if (actionTimer <= 0) { actionTimer = 100;{ //Edit the (1500) to change the time of the message PlayerHandler.messageToAll = ("PUT YOUR MESSAGE HERE"); //This yells the message out } } }
Like
Also there is a better place to put it than boolean process because process will lag it, but ill let you figure that outCode:public void advertise(){ //This is the advertising method if (actionTimer <= 0) { if (misc.random(2) == 1){ //Edit the (1500) to change the time of the message PlayerHandler.messageToAll = ("FIRST MESSAGE"); //This yells the message out } else { if (misc.random(2) == 2){ actionTimer = 100; PlayerHandler.messageToAll = ("SECOND MESSAGE"); } } }
Nice tut anywayz
I know you can add it to another method if you wanted to, so the method only gets called once.Also there is a better place to put it than boolean process because process will lag it, but ill let you figure that out
Nice tut anywayz
Although i was teaching people how to make a method, and call it at the same time.
And i like my way better, because its a random.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |