Creating Voicecommand
Posted: Thu Apr 05, 2012 11:03 am
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:
L2JDP Revision Number:
Ive built off the Clan Leader script here in forums,
And corrected as asked thru consul but now dont give me errors but wont load.
anyone give a hand?
» Find Revision
L2J Revision Number:
L2JDP Revision Number:
Ive built off the Clan Leader script here in forums,
And corrected as asked thru consul but now dont give me errors but wont load.
anyone give a hand?
Code: Select all
package com.l2jserver.gameserver.handlers.voicedcommandhandlers; import com.l2jserver.gameserver.handler.IVoicedCommandHandler;import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; public class Party implements IVoicedCommandHandler{ private static final String[]_voicedCommands = {"mypt"}; public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if (command.startsWith("mypt")) { L2PcInstance leader = null; if (activeChar.getParty() != null) leader = activeChar.getParty().getLeader(); else { activeChar.sendMessage("You don't have a Party.."); return false; } if (leader.isInOlympiadMode() || leader.isTeleporting() || leader.isInCombat() || leader.isInJail() || leader.isFlying() || leader.isIn7sDungeon()) { activeChar.sendMessage("You cannot teleport to your leader now"); return false; } int leaderX = leader.getX(); int leaderY = leader.getY(); int leaderZ = leader.getZ(); activeChar.sendMessage("You are teleporting to your Party leader"); activeChar.teleToLocation(leaderX, leaderY, leaderZ); leader.sendMessage(activeChar.getName() + " is teleporting to you."); } return true; } public String[] getVoicedCommandList() { return _voicedCommands; }}