Thread: Need Help to Stop Teleing in Combat ( REP++)

Results 1 to 7 of 7
  1. #1 Need Help to Stop Teleing in Combat ( REP++) 
    Registered Member every1thing's Avatar
    Join Date
    Dec 2009
    Posts
    232
    Thanks given
    2
    Thanks received
    2
    Rep Power
    13
    Hi guys its me again =PP
    I am trying to stop teleing in combat due to there is a big bug if a allow it

    So far this is how i have written it:
    Code:
                    if (combatDelay <= 0) {
    				combatDelay = 10;
    
    				} else
    					sendMessage("You can't Teleport in Combat.");
    );
    All it does is say you can't tele in combat but it doesnt stop them teleing. How i stop them?

    Thanks
    MOW387

    [B]Emps-scape 600+ Players!

    20 Skills Working Now
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Oct 2009
    Posts
    438
    Thanks given
    29
    Thanks received
    108
    Rep Power
    0
    Code:
    if (inCombat); 
    	private static final long lastCombat = 0;
    	private boolean inCombat;
    
    	{
    		long current = System.currentTimeMillis();
    		if(current - lastCombat >= 10000) {
    			inCombat = false;
    		}
    OR

    Code:
    	if (combatDelay <= 0) {
    			int combatDelay = 10;
    
    	} else
    			void sendMessage("You can't Teleport in Combat.");
    					return;
    
    		}
    Last edited by Stormrider; 08-16-2010 at 09:55 AM. Reason: Added another way to fix this
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Mar 2009
    Posts
    372
    Thanks given
    12
    Thanks received
    9
    Rep Power
    0
    You need to declare something that reads if you are in combat

    Then you can make something that says somethine like
    if!inCombat then tele }else{ tele


    maybe soemthing like this?

    Code:
    		if (inCombat) {
    		long current = System.currentTimeMillis();
    		if(current - lastCombat >= 10000) {
    			inCombat = false;
    		}
    Reply With Quote  
     

  4. #4  
    Registered Member every1thing's Avatar
    Join Date
    Dec 2009
    Posts
    232
    Thanks given
    2
    Thanks received
    2
    Rep Power
    13
    didnt work out still need help!
    MOW387

    [B]Emps-scape 600+ Players!

    20 Skills Working Now
    Reply With Quote  
     

  5. #5  
    Officially Retired

    Huey's Avatar
    Join Date
    Jan 2008
    Age
    22
    Posts
    16,478
    Thanks given
    3,385
    Thanks received
    7,727
    Rep Power
    5000
    If it's PI just add
    return;
    sendMessage("You can't teleport while in combat");
    Attached image
    Listen children don't become this guy.
    Quote Originally Posted by Owner Spikey View Post
    Why can I attack lower level npc's in a matter of a mouse hover but for a higher level npc the only choice to attack is by right clicking option attack?

    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Oct 2009
    Posts
    438
    Thanks given
    29
    Thanks received
    108
    Rep Power
    0
    Your missing a few things
    to the author

    such as } else {
    a public void ect.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jun 2010
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Code:
    	
    player.getActionSender().removeTab1();
    	if(player.SafeZone()) {
    	player.getTele();
    	Teleport.telePlayer(player, 2340, 3541, 0, 0);
    	} else if (Location.wildernessLevel(player.getLocation()) > 1) {
    		player.sm("you cannot teleport in the wilderness");
    	} else {
    		player.getTele();
    		Teleport.telePlayer(player, 2340, 3541, 0, 0);
    	}
    }
    Add that into the command? it'd stop them from teleing in the wildy? which in a sense would stop them from teleing in combat :L
    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
  •