Thread: [PI] Server chooses where you go.

Results 1 to 8 of 8
  1. #1 [PI] Server chooses where you go. 
    Registered Member Gh0stPred's Avatar
    Join Date
    Apr 2013
    Posts
    136
    Thanks given
    35
    Thanks received
    9
    Rep Power
    11
    I am trying to make this object to teleport me to 3 different places and I am not sure what the code is. I was thinking it might be

    Spoiler for This:
    c.getPA().startTeleport2(xxxx, yyyy, 0) ||c.getPA().startTeleport2(xxxx, yyyy, 0) ;


    but that looks stupid

    Does anyone have a much better code so I can place in my server
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Mar 2013
    Posts
    3,036
    Thanks given
    82
    Thanks received
    375
    Rep Power
    0
    use dialogues for options and for each option make it teleport you.
    Reply With Quote  
     

  3. #3  
    true

    DerekH's Avatar
    Join Date
    Dec 2011
    Age
    19
    Posts
    1,183
    Thanks given
    590
    Thanks received
    261
    Rep Power
    164
    What?
    Code:
     if (objectId == ###) {
    c.getPA().startTeleport2(x, y, h);
    }
    Or just make a new dialogue so when you click the object you do
    Code:
    c.getDH().sendDialogue(#);
    then have the choices etc.
    Reply With Quote  
     

  4. #4  
    Registered Member Gh0stPred's Avatar
    Join Date
    Apr 2013
    Posts
    136
    Thanks given
    35
    Thanks received
    9
    Rep Power
    11
    But I don't want the players to have a choice. It's kinda like the Bounty Hunter craters where you click on it and it takes you to a random place inside Bounty Hunter. I want it to kinda be like that if you get what I mean
    Reply With Quote  
     

  5. #5  
    true

    DerekH's Avatar
    Join Date
    Dec 2011
    Age
    19
    Posts
    1,183
    Thanks given
    590
    Thanks received
    261
    Rep Power
    164
    Quote Originally Posted by Gh0stPred View Post
    But I don't want the players to have a choice. It's kinda like the Bounty Hunter craters where you click on it and it takes you to a random place inside Bounty Hunter. I want it to kinda be like that if you get what I mean
    Code:
     if (objid = ##) {
    int i = Misc.random(3);
    if (i == 1) {
    teleShit();
    }
    if (i==2) {
    teleshit();
    }
    if (i==3) {
    teleshit();
    }}
    Pretty much sums it up.
    Reply With Quote  
     

  6. #6  
    Registered Member Gh0stPred's Avatar
    Join Date
    Apr 2013
    Posts
    136
    Thanks given
    35
    Thanks received
    9
    Rep Power
    11
    Quote Originally Posted by derekh View Post
    Code:
     if (objid = ##) {
    int i = Misc.random(3);
    if (i == 1) {
    teleShit();
    }
    if (i==2) {
    teleshit();
    }
    if (i==3) {
    teleshit();
    }}
    Pretty much sums it up.
    Thx I'll see if it works or not
    Reply With Quote  
     

  7. #7  
    Registered Member Arth's Avatar
    Join Date
    May 2011
    Posts
    751
    Thanks given
    29
    Thanks received
    39
    Rep Power
    9
    Code:
    	public void randomTele() {
    		Random rNum = new Random();
    		int num;
    		num = rNum.nextInt(3) + 1;
    
    		switch(num) {
    
    		case 1:
    			teleShit();
    			break;
    		case 2:
    			teleShit();
    			break;
    		case 3:
    			teleShit();
    			break;
    		}
    
    	}
    make sure to import Random
    Code:
    import java.util.Random;
    Then
    Code:
    if (objid = ##) {
    randomTele();
    c.sendMessage("You've teleported to a random place dude");
    }
    havnt even checked this out but it should work
    Spoiler for Dont Click Me!:
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jul 2013
    Posts
    106
    Thanks given
    3
    Thanks received
    3
    Rep Power
    10
    Public void randomTele() {
    if (objectid = Ex: The crator ID) {
    int i = Misc.random(3);
    if (i == 1) {
    c.getPA().startTeleport("x coord, y coord, z coord");
    }
    if (i==2) {
    c.getPA().startTeleport("x coord, y coord, z coord");
    }
    if (i==3) {
    c.getPA().startTeleport("x coord, y coord, z coord");
    }
    }
    }

    Not sure if the annotations mark (""""""") should be between. If it doesn't, remove them.

    Credits:
    att ftw
    Derekh
    Me For combining them and making a few adjustements.
    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. Replies: 1
    Last Post: 01-24-2011, 11:20 AM
  2. No matter where you go...
    By Mr Chainsaw in forum Chat
    Replies: 0
    Last Post: 08-10-2010, 03:41 PM
  3. Where are you going for Summer?
    By Marker in forum Voting
    Replies: 31
    Last Post: 06-06-2009, 01:59 PM
  4. Replies: 8
    Last Post: 12-01-2008, 12:20 AM
  5. Replies: 67
    Last Post: 12-02-2007, 05:50 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
  •