Thread: Duel Request

Results 1 to 6 of 6
  1. #1 Duel Request 
    Registered Member
    Swarfega's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    873
    Thanks given
    0
    Thanks received
    1
    Rep Power
    373
    Hi.

    I'm in need of some help with the Duel Request.

    I convereted hayzies Duelling from Emulous to a regular based server, but the hard part is the Duel Requesting(As always).

    I don't know what packet it should go to.. These are my Duelling packets:

    Code:
    		case 153:
    			break;
          case 139:
    int answerPlayer = inStream.readUnsignedWord();
    if(server.playerHandler.players[answerPlayer] == null) {
    return;
    }
    if(arenas() || duelStatus == 5) {
    sM("You can't challenge inside the arena!");
    return;
    }
    requestDuel(answerPlayer);
            break;
    But when I try it, nothing happens. Nothing at all.

    Any help?

    ---------- Post added at 08:13 PM ---------- Previous post was at 07:58 PM ----------

    Oh and here's requestduel method:

    Code:
    	public void requestDuel(int id) {
    		try {
    			resetDuel();
    			resetDuelItems();
    			duelingWith = id;
    			client o = (client) server.playerHandler.players[id];
    			if(o == null) {
    				return;
    			}
    			duelRequested = true;
    			if(duelStatus == 0 && o.duelStatus == 0 && duelRequested && o.duelRequested && duelingWith == o.getId() && o.duelingWith == getId()) {
    				if(GoodDistance(o.absX, o.absY, absX, absY, 8) == false){			
    					openDuel();
    					o.openDuel();
    				} else {
    					sM("You need to get closer to your opponent to start the duel.");
    				}
    
    			} else {
    				sM("Sending duel request...");
    				o.sM(playerName+":duelreq:");		
    			}
    		} catch (Exception e) {
    			System.out.println("Error requesting duel.");
    		}
    	}
    Reply With Quote  
     

  2. #2  
    Registered Member
    PrototypeXY's Avatar
    Join Date
    Mar 2009
    Posts
    71
    Thanks given
    0
    Thanks received
    0
    Rep Power
    199
    Have you compiled? Seriously ,you have to have a class file for it. So try that. If you have, tell me your source and/or client type and I'll help you right away! (If I'm no help, use google.com)
    Reply With Quote  
     

  3. #3  
    Registered Member
    Swarfega's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    873
    Thanks given
    0
    Thanks received
    1
    Rep Power
    373
    I've compiled, no errors. I'm not stupid. All the methods have been converted and works. When I make a command for the thing saying Playername challenges you to a duel, it works, but it don't work with the click like right click name?
    Reply With Quote  
     

  4. #4  
    Registered Member
    CTucker's Avatar
    Join Date
    Oct 2008
    Posts
    2,422
    Thanks given
    263
    Thanks received
    281
    Rep Power
    343
    search for attack untill it shows this ("attack")

    then copy that code and make it

    ("challenge") not hard ")
    Reply With Quote  
     

  5. #5  
    Registered Member
    Swarfega's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    873
    Thanks given
    0
    Thanks received
    1
    Rep Power
    373
    Quote Originally Posted by dds3030 View Post
    search for attack untill it shows this ("attack")

    then copy that code and make it

    ("challenge") not hard ")
    Lol @ You. Chaning that will have same effect, it will attack player just that it says "Challenge" rofl.

    Anyways already fixed this on my own, so don't bother posting here.
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Jul 2008
    Posts
    458
    Thanks given
    5
    Thanks received
    11
    Rep Power
    0
    Gratz that you fixed it.
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •