Thread: Determining if a player is a square away

Results 1 to 6 of 6
  1. #1 Determining if a player is a square away 
    Kanketsu
    JacobiYounger's Avatar
    Join Date
    Aug 2009
    Posts
    723
    Thanks given
    49
    Thanks received
    31
    Rep Power
    31
    Code:
    if (c.getX() != c2.getX() && c.getY() != c2.getY() && !c.usingOtherRangeWeapons && !c.getCombat().usingHally() && !c.usingBow && !c.usingMagic) {
    					c.faceUpdate(i+32768); //face the player
    				    c.getPA().stopDiagonal(c2.getX(), c2.getY());//move to a correct spot
    					return;
    				}
    I just basically need a piece of a code before this, possibly a if statement saying if this player is in the region of a square away to use the statement above.
    Reply With Quote  
     

  2. #2  
    Kanketsu
    JacobiYounger's Avatar
    Join Date
    Aug 2009
    Posts
    723
    Thanks given
    49
    Thanks received
    31
    Rep Power
    31
    Anyone?
    Reply With Quote  
     

  3. #3  
    Banned Determining if a player is a square away Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    use withinDistance
    Reply With Quote  
     

  4. #4  
    Kanketsu
    JacobiYounger's Avatar
    Join Date
    Aug 2009
    Posts
    723
    Thanks given
    49
    Thanks received
    31
    Rep Power
    31
    Code:
    Client p = (Client) PlayerHandler.players[i];
    				
    				// c.sendMessage("Made it here1.");
    				if (p.WithinDistance(c.absX, c.absY, p.absX, p.absY, 1) &&
    					
    				c.getX() != p.getX() && c.getY() != p.getY() && !c.usingOtherRangeWeapons && !c.getCombat().usingHally() && !c.usingBow && !c.usingMagic) {
    					c.faceUpdate(i+32768); //face the player
    				    c.getPA().stopDiagonal(p.getX(), p.getY());//move to a correct spot
    					return;
    				
    				}
    I figured it out. =]
    Reply With Quote  
     

  5. #5  
    Banned Determining if a player is a square away Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    Quote Originally Posted by JacobiYounger View Post
    Code:
    Client p = (Client) PlayerHandler.players[i];
    				
    				// c.sendMessage("Made it here1.");
    				if (p.WithinDistance(c.absX, c.absY, p.absX, p.absY, 1) &&
    					
    				c.getX() != p.getX() && c.getY() != p.getY() && !c.usingOtherRangeWeapons && !c.getCombat().usingHally() && !c.usingBow && !c.usingMagic) {
    					c.faceUpdate(i+32768); //face the player
    				    c.getPA().stopDiagonal(p.getX(), p.getY());//move to a correct spot
    					return;
    				
    				}
    I figured it out. =]
    congrats
    Reply With Quote  
     

  6. #6  
    Kanketsu
    JacobiYounger's Avatar
    Join Date
    Aug 2009
    Posts
    723
    Thanks given
    49
    Thanks received
    31
    Rep Power
    31
    Quote Originally Posted by lare96 View Post
    congrats
    Erg.. It works perfect with melee, but if your using range right next to the player it fixes it too.. Like you can't diagonal with the other player.
    Is there a quick fix for this? I've been messing around with this for about 30 minutes now...
    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. Pi helm check if a player is online
    By NoChildSupport in forum Help
    Replies: 0
    Last Post: 07-26-2013, 08:37 PM
  2. Replies: 7
    Last Post: 05-29-2013, 09:00 AM
  3. A check if a player is viewing a sidebar?
    By MistaahSells in forum Help
    Replies: 7
    Last Post: 12-04-2012, 02:36 AM
  4. Replies: 7
    Last Post: 07-28-2010, 11:47 AM
  5. Replies: 10
    Last Post: 07-24-2009, 02:05 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
  •