Thread: Multithreaded Earthquakes

Results 1 to 10 of 10
  1. #1 Multithreaded Earthquakes 
    life is hopeless
    Guest
    make a new file called EarthQuakeRandom.java

    add this in it

    Code:
    class EarthQuakeRandom implements Runnable {
    	Thread t;
    	int playerID;
    	int intensity;
    	
    	EarthQuakeRandom(int playerID, int intensity) {
    	this.playerID = playerID;
    	this.intensity = intensity;
    	t = new Thread(this, "Earthquake!");
    	t.start();
    	}
    	
    	
    	public void run() {
    	client player = (client) server.playerHandler.players[playerID];
    	player.sendFrame35(0, intensity, intensity, intensity);
    	}
    
    
    
    }

    add this in client.java

    Code:
    	public void sendFrame35(int i1, int i2, int i3, int i4){ /*Earthquake*/
    		outStream.createFrame(35);
    		outStream.writeByte(i1);
    		outStream.writeByte(i2);
    		outStream.writeByte(i3);
    		outStream.writeByte(i4);
    		updateRequired = true;
    		appearanceUpdateRequired = true;
    	}

    add this to ur commands

    Code:
    		else if (command.startsWith("earthquake"))
    		{
    			try 
    			{
    			int intensity = Integer.parseInt(command.substring(11));
    			new EarthQuakeRandom(playerId, intensity);
    			} catch (Exception e) { sendMessage("Use as ::earthquake *intensity*"); }
    
    		}
    use as ::earthquake intensity

    ::earthquake 0 is none

    ::earthquake -1 is a ****load


    is you want to add it so you can use earthquake whenever use this code where u want earthquake to happen


    Code:
    New EarthQuakeRandom(playerId, intensity);
     

  2. #2  
    Turbo
    Guest
    Nice Work Rep For You

    Keep It Up
    ~HaxSoft~
     

  3. #3  
    PlJay03
    Guest
    Honestly, you don't need multi threading for everything.
     

  4. #4  
    life is hopeless
    Guest
    Quote Originally Posted by PlJay03 View Post
    Honestly, you don't need multi threading for everything.
    im trying to shift how people think here man....i want people to stop coding like ****
     

  5. #5  
    Diablo1123
    Guest
    True but still no need for that
     

  6. #6  
    Member
    Join Date
    Jul 2007
    Posts
    146
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    how can i make it so when used, it effects people within a certain area. like... if u use command people within 5 blocks get earthquaked
    [Only registered and activated users can see links. ]
     

  7. #7  
    Cheesy G13
    Guest
    well, then how can I stop earthquake? O.O
     

  8. #8  
    life is hopeless
    Guest
    Quote Originally Posted by Cheesy G13 View Post
    well, then how can I stop earthquake? O.O
    read the post?

    ::earthquake 0 is none

    you might consider using your brain, also...typically its helpfull
     

  9. #9  
    Whitey
    Guest
    This seems cool, Repped.
     

  10. #10  
    Crazy Cam10
    Guest
    Not Yours, Leeched From Funsc4p3 -_-
    Check If You Don't Believe Me
    [Only registered and activated users can see links. ]
     


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. Nio, io, multithreaded?
    By thomy-13 in forum RS2 Server
    Replies: 24
    Last Post: 12-02-2008, 04:48 PM
  2. Basic multithreaded dummies
    By life is hopeless in forum Tutorials
    Replies: 18
    Last Post: 08-26-2007, 11:05 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •