Jump to content
Sign in to follow this  
king rauddys

317 [Delta] Announcements.java [Delta]

Recommended Posts

I ALSO POSTED THIS ON R-S!! ( KING JAYDEN )..


Purpose: Sending a announcement in a random colour every 3 minutes.
Edited: Client.java.
Added: Announcements.java

Difficulty: 1/10 ( copy/paste ).

First make a new class & call it: Announcements.java

Copy & paste this into it:

[CODE]/**
*
* Announcements.java
* by jayden
*
**/

public class Announcements //The announcements class.
{


public static void main(String[] args)//used this instead of process, this gets the string & the colour.
{
while (true)
{
int i = misc.random(announcements.length - 1);
System.out.println("[Server]: " + announcements[i]);
try
{
Thread.sleep(1000);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}

public static String[] announcements = //the announcements, edit them for yourself.
{
"Please vote for the server!",
"Do ::commands to get a list of commands!",
"Try ::funpk to test your strength without losing items!",
"Jayden is the owner!",
"Please donate to keep the server alive!",
"No player jumping!",
"Report cheaters!",
"Report all ingame glitches to Jayden & Erik.",
"help other players!!",
"Advertising will help the server gain more players",
"Kill bosses for expensive items! ::bosses.",
"Do you like pk? Pvp is even cooler! ::pvp.",
"Donate for rare items like special godswords!",
"Do you have questions? Ask our pro-staff team.",
"Drop party's if online playercount reaches 25, 50, etc.",
"Do you have a idea or suggestion? tell Erik or Jayden!",
"Donate and get your name boradcasted here!! ",
"Staff doesnt give free items! dont ask..",
"Kill high-leveled npc's for special rewards and rares!",
"www.****project.createaforum.com - Forums!",
};

public static String[] colours = //those are the colours, if your client doesnt accept them just change.
{
"@[email protected]",
"@[email protected]",
"@[email protected]",
"@[email protected]",
"@[email protected]",
"@[email protected]",
"@[email protected]",
"@[email protected]",
"@[email protected]",
"@[email protected]",
"@[email protected]",

};

public static String getAnno()//this will send the annnouncement + the colour.
{
int w = misc.random(colours.length - 1);
int i = misc.random(announcements.length - 1);
return ("[@[email protected]@[email protected]]: @[email protected]" + colours[w] + announcements[i]);
}
}[/CODE]


Next, open up client.java

search for:

Code:
[CODE]public boolean process()[/CODE]

add this directly below:

Code:
[CODE]if (System.currentTimeMillis() - announcementTimer > 90000) { //3 minutes
announcementTimer = System.currentTimeMillis();
sM(Announcements.getAnno());

}
[/CODE]

Sorry for not explaining allot, but this is soo easy..

===================================

TESTED THIS ON DDSSPECED SOURCE [ DELTA ] & It works.


Dont flame because of delta, only people who can't code delta's flame.

Share this post


Link to post
Share on other sites
hello,

one question where to make the Announcements.java file
in the server or client side?

Share this post


Link to post
Share on other sites
Sign in to follow this  

×