Thread: Duel Arena Help [PI]

Results 1 to 4 of 4
  1. #1 Duel Arena Help [PI] 
    Registered Member
    Join Date
    Jul 2015
    Posts
    23
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Hello R-S,

    I got 2 problems..

    #1:
    Player 1 shows the countdown, player 2 isnt showing the countdown.



    #2:

    Player 1 can attack, player 2 can't attack and says: The Duel Hasn't started yet!



    ClickingButtons.java
    Code:
    case 25120:
    			if(c.duelStatus == 5) {
    				break;
    			}
    			Client o1 = (Client) Server.playerHandler.players[c.duelingWith];
    			if(o1 == null) {
    				c.getTradeAndDuel().declineDuel();
    				return;
    			}
    
    			c.duelStatus = 4;
    			if(o1.duelStatus == 4 && c.duelStatus == 4) {				
    				c.getTradeAndDuel().startDuel();
    				o1.getTradeAndDuel().startDuel();
    				o1.duelCount = 4;
    				c.duelCount = 4;
    				CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
    					@Override
    					public void execute(CycleEventContainer container) {
    						if(System.currentTimeMillis() - c.duelDelay > 800 && c.duelCount > 0) {
    							if(c.duelCount != 1) {
    								c.forcedChat(""+(--c.duelCount));
    								c.duelDelay = System.currentTimeMillis();
    							} else {
    								c.damageTaken = new int[Config.MAX_PLAYERS];
    								c.forcedChat("FIGHT!");
    								c.duelCount = 0;
    							}
    						}
    						if (c.duelCount == 0) {
    							container.stop();
    						}
    					}
    					@Override
    					public void stop() {
    					}
    				}, 1);
    				c.duelDelay = System.currentTimeMillis();
    				o1.duelDelay = System.currentTimeMillis();
    			} else {
    				c.getPA().sendFrame126("Waiting for other player...", 6571);
    				o1.getPA().sendFrame126("Other player has accepted", 6571);
    			}
    			break;
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Mar 2015
    Posts
    37
    Thanks given
    0
    Thanks received
    9
    Rep Power
    11
    Code:
    				CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
    					@Override
    					public void execute(CycleEventContainer container) {
    						if(System.currentTimeMillis() - c.duelDelay > 800 && c.duelCount > 0) {
    							if(c.duelCount != 1) {
    								c.forcedChat(""+(--c.duelCount));
    								c.duelDelay = System.currentTimeMillis();
    							} else {
    								c.damageTaken = new int[Config.MAX_PLAYERS];
    								c.forcedChat("FIGHT!");
    								c.duelCount = 0;
    							}
    						}
    						if (c.duelCount == 0) {
    							container.stop();
    						}
    					}
    					@Override
    					public void stop() {
    					}
    				}, 1);
    The last player to accept is the only one to have that event used.
    Attached image
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2015
    Posts
    23
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    How can i fix this?
    Reply With Quote  
     

  4. #4  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,436
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    Code:
    case 25120:
    			if(c.duelStatus == 5) {
    				break;
    			}
    			Client o1 = (Client) Server.playerHandler.players[c.duelingWith];
    			if(o1 == null) {
    				c.getTradeAndDuel().declineDuel();
    				return;
    			}
    
    			c.duelStatus = 4;
    			if(o1.duelStatus == 4 && c.duelStatus == 4) {				
    				c.getTradeAndDuel().startDuel();
    				o1.getTradeAndDuel().startDuel();
    				o1.duelCount = 4;
    				c.duelCount = 4;
    				CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
    					@Override
    					public void execute(CycleEventContainer container) {
    						if(System.currentTimeMillis() - c.duelDelay > 800 && c.duelCount > 0) {
    Client other = (Client) Server.playerHandler.players[c.duelingWith];
    							if(c.duelCount != 1 && other.duelCount != 1) {
    								c.forcedChat(""+(--c.duelCount));
    								c.duelDelay = System.currentTimeMillis();
    other.forcedChat(""+(--c.duelCount));
    other.duelDelay = System.currentTimeMillis();
    							} else {
    								c.damageTaken = new int[Config.MAX_PLAYERS];
    								c.forcedChat("FIGHT!");
    								c.duelCount = 0;
    								other.damageTaken = new int[Config.MAX_PLAYERS];
    								other.forcedChat("FIGHT!");
    								other.duelCount = 0;
    							}
    						}
    						if (c.duelCount == 0) {
    							container.stop();
    						}
    					}
    					@Override
    					public void stop() {
    					}
    				}, 1);
    				c.duelDelay = System.currentTimeMillis();
    				o1.duelDelay = System.currentTimeMillis();
    			} else {
    				c.getPA().sendFrame126("Waiting for other player...", 6571);
    				o1.getPA().sendFrame126("Other player has accepted", 6571);
    			}
    			break;
    that will work, but why the fuck is the damagetaken being called off the the int max_players?? and why isnt it a byte, and why the fuck is it a multidimensional array instead of an increasing value, stupid pi

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    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. Duel Arena Help [PI]
    By tha ranqe in forum Help
    Replies: 0
    Last Post: 10-12-2015, 07:44 PM
  2. [Duel Arena Help?] Pi
    By xoodreyoox in forum Help
    Replies: 3
    Last Post: 09-26-2013, 12:15 AM
  3. Duel arena help [PI]
    By Right man in forum Help
    Replies: 0
    Last Post: 07-01-2011, 12:53 PM
  4. [PI] Duel Arena help Rep++
    By Char Char in forum Help
    Replies: 3
    Last Post: 01-30-2011, 05:58 PM
  5. duel arena help [PI]
    By miggz212 in forum Help
    Replies: 7
    Last Post: 08-31-2010, 05:53 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
  •