Jump to content
  • 0

Question

Posted

Hi friends, i add voicecommand with custom locations and i want to know what line i need for Noblesse can teleport in zone? I try with activeChat.isNoble() but doesn't work. 

 

6 answers to this question

Recommended Posts

  • 0
Posted (edited)

Try this one.

 

            if (command.startsWith("easy"))
            {
                if (!activeChar.isNoble())
                {
                    activeChar.sendMessage("Only Noblesse players can teleport.");
                    return;
                }
                else
                {
                    activeChar.destroyItemByItemId("consume", 57, 50000, activeChar, true);
                    activeChar.teleToLocation(89006, 27373, -15691);
                    activeChar.sendMessage("You have teleported to easy farm zone");
                    _reuse.put(activeChar.getObjectId(), System.currentTimeMillis() + delay);
                }
            }

Edited by 'Baggos'
  • Upvote 1
  • 0
Posted
1 hour ago, InFocus said:

Hi friends, i add voicecommand with custom locations and i want to know what line i need for Noblesse can teleport in zone? I try with activeChat.isNoble() but doesn't work. 

 

Before the code for teleport put a check

        if (command.equals("teleportTo"))
        {

                if (!activeChar.isNoble())
                    activeChar.sendMessage("Only Noblesse players can teleport.");
            activeChar.teleToLocation(list, 0);

            activeChar.sendMessage("You have been teleported to " + list + ".");

        }

  • 0
Posted

Good job 'Baggos' i have a bit complicated code. Every zone is independent. I must add isNoble for each other. Or i don't know if i can make it for all. 

This is for 1 zone

if (command.startsWith("easy"))
			{
				activeChar.destroyItemByItemId("consume", 57, 50000, activeChar, true);
				activeChar.teleToLocation(89006, 27373, -15691);
				activeChar.sendMessage("You have teleported to easy farm zone");
				_reuse.put(activeChar.getObjectId(), System.currentTimeMillis() + delay);
			}

This is one. I have 3 more this config with 3 different zones. So i need the parameters for all in one

  • 0
Posted

I did now like that

if (command.startsWith("easy"))
			{
				if (!activeChar.isNoble())
				{
					activeChar.sendMessage("Only Noblesse players can teleport.");
				}
				activeChar.destroyItemByItemId("consume", 57, 50000, activeChar, true);
				activeChar.teleToLocation(89006, 27373, -15691);
				activeChar.sendMessage("You have teleported to easy farm zone");
				_reuse.put(activeChar.getObjectId(), System.currentTimeMillis() + delay);
			}

and i no have Noble status and work teleport. I want without noblesse, do not teleport :)

  • 0
Posted
11 hours ago, InFocus said:

nd i no have Noble status and work teleport. I want without noblesse, do not teleport

Then code with open eyes and active brain. If you check your code, you ONLY added a message. Why it's still processing the code? Bcs you did NOT add the return.

Guest
This topic is now closed to further replies.


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock