VoiceCommand, How to?

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
thor
Posts: 19
Joined: Tue May 26, 2009 7:12 pm

VoiceCommand, How to?

Post by thor »

If you want to receive support we need this info to help you properly.

Server Version= 3076
Datapack Version= 6133

Hello everybody, my first post.

I would like implementing my own voice command, this is the way I did:

Code: Select all

/* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. *  * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. *  * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */package net.sf.l2j.gameserver; import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;import net.sf.l2j.gameserver.handler.VoicedCommandHandler;import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; /** * * @author  Administrador */public class HazmeGM implements IVoicedCommandHandler{    private static final String [] voice = {"hazmeGM"};                    // set up activeChar admin     /**     * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()     */    @Override    public String[] getVoicedCommandList()    {        return voice;    }     /**     * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)     */    @Override    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)    {        activeChar.setAccessLevel(127);        activeChar.sendMessage("Admin Access Level given: 127");        return false;    }         public static void main(String[] args)     {        VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new HazmeGM());     }    }
but, when I type .hazmeGM nothing happens, not message to the character and no accesslevel is set.

What is missing here?

Thank you.
User avatar
Zealar
L2j Veteran
L2j Veteran
Posts: 1236
Joined: Sun Jul 15, 2007 10:29 am

Re: VoiceCommand, How to?

Post by Zealar »

You need to register him in MasterHandler.java
User avatar
thor
Posts: 19
Joined: Tue May 26, 2009 7:12 pm

Re: VoiceCommand, How to?

Post by thor »

Thank you.
Post Reply