Thread: [PI] Repeating message/Timed message

Results 1 to 8 of 8
  1. #1 [PI] Repeating message/Timed message 
    Banned
    Join Date
    Aug 2010
    Age
    27
    Posts
    119
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Hello,

    I dont know how to call this but I would like to have a system
    on my server that could for example every 30 minutes send all players a certain message example " Please vote on rune-server" or something.

    Any tips? :]
    Reply With Quote  
     

  2. #2  
    Registered Member Satan666's Avatar
    Join Date
    May 2010
    Posts
    449
    Thanks given
    65
    Thanks received
    100
    Rep Power
    15
    open up client.java and add this somewhere.

    Code:
    public void mymessage() {
    		EventManager.getSingleton().addEvent(new Event() {
    			public void execute(EventContainer c) {
    				sendMessage("[@[email protected] [email protected]@] Hello " +playerName+". @[email protected]::[email protected]@ opens op our vote4Cash system.");
    				sendMessage("[@[email protected] [email protected]@] Hello " +playerName+". register at out forums! @[email protected]::forum");
    	        }
    	    }, 1000000); //Change the timers here ;] 
    	};
    then still in client.java in
    Code:
    	public void initialize() {
    		mymessage();
    =]
    Reply With Quote  
     

  3. #3  
    /non-logical thought
    Ivan's Avatar
    Join Date
    May 2010
    Posts
    120
    Thanks given
    11
    Thanks received
    4
    Rep Power
    1
    Quote Originally Posted by Satan666 View Post
    open up client.java and add this somewhere.

    Code:
    public void mymessage() {
    		EventManager.getSingleton().addEvent(new Event() {
    			public void execute(EventContainer c) {
    				sendMessage("[@[email protected] [email protected]@] Hello " +playerName+". @[email protected]::[email protected]@ opens op our vote4Cash system.");
    				sendMessage("[@[email protected] [email protected]@] Hello " +playerName+". register at out forums! @[email protected]::forum");
    	        }
    	    }, 1000000); //Change the timers here ;] 
    	};
    then still in client.java in
    Code:
    	public void initialize() {
    		mymessage();
    =]
    I don't think that will work.



    You basically need to add a timer...

    In 'server.java', under 'public class server implements Runnable {'
    Add:
    Code:
    public static int NAME HERE = 1800000
    In 'client.java', two lines under 'public boolean process() {'
    Add:
    Code:
        if(server.NAME HERE > -1){
            server.NAME HERE -= 1;
        }
        if(server.NAME HERE == 0){
            yell("Message Here.");
            server.NAME HERE = 1800000;
        }
    Save, Compile.
    Reply With Quote  
     

  4. #4  
    Registered Member Satan666's Avatar
    Join Date
    May 2010
    Posts
    449
    Thanks given
    65
    Thanks received
    100
    Rep Power
    15
    It works 100% perfect on a PI server. I have it in my server. so you sir are wrong.
    Reply With Quote  
     

  5. #5  
    /non-logical thought
    Ivan's Avatar
    Join Date
    May 2010
    Posts
    120
    Thanks given
    11
    Thanks received
    4
    Rep Power
    1
    Quote Originally Posted by Satan666 View Post
    It works 100% perfect on a PI server. I have it in my server. so you sir are wrong.
    I'm not familiar with 'EventManager' but I have a feeling you missed out the part where the timer goes down by 1?



    Example:
    Code:
        if(server.NAME HERE > -1){
            server.NAME HERE -= 1;
        }

    ... but like I said, I'm not familiar with 'EventManager' so I still may be wrong.
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Jul 2010
    Age
    26
    Posts
    1,144
    Thanks given
    7
    Thanks received
    48
    Rep Power
    0
    The way Satan did it was fine it works 100% for me anyways.
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Aug 2010
    Age
    27
    Posts
    119
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Oh thanks people :] Repped
    Reply With Quote  
     

  8. #8  
    /non-logical thought
    Ivan's Avatar
    Join Date
    May 2010
    Posts
    120
    Thanks given
    11
    Thanks received
    4
    Rep Power
    1
    Quote Originally Posted by Vegas View Post
    Oh thanks people :] Repped
    No problems
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. message when you log in
    By tonic in forum Help
    Replies: 14
    Last Post: 03-02-2009, 10:18 PM
  2. GFX repeating
    By Pie in forum Help
    Replies: 1
    Last Post: 01-26-2009, 01:18 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •