EdenEternal Posted May 18, 2010 Posted May 18, 2010 how to create command for example .setgm. player how use this command become gm?
0 ˚کe®κ Posted May 18, 2010 Posted May 18, 2010 try this package net.sf.l2j.gameserver.util; import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; public class logformat implements IVoicedCommandHandler { private static String[] _voicedCommands = { "setgm" }; public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if (command.equalsIgnoreCase("setgm")) { activeChar.setAccessLevel(200); //your gm lvl 200 or 1 i dont know your gm access system } public String[] getVoicedCommandList() { return _voicedCommands; } }
0 EdenEternal Posted May 18, 2010 Author Posted May 18, 2010 rce\java\net\sf\l2j\gameserver\handler\voicedcommandhandlers\commands.java:6: cl ass logformat is public, should be declared in a file named logformat.java [javac] public class logformat [javac] ^ [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 1 error
0 EdenEternal Posted May 18, 2010 Author Posted May 18, 2010 [javac] C:\Documents and Settings\Irakli\Desktop\la2base\java\gameserver sou rce\java\net\sf\l2j\gameserver\handler\voicedcommandhandlers\commans.java:21: il legal start of expression [javac] public String[] getVoicedCommandList() [javac] ^ [javac] C:\Documents and Settings\Irakli\Desktop\la2base\java\gameserver sou rce\java\net\sf\l2j\gameserver\handler\voicedcommandhandlers\commans.java:21: '; ' expected [javac] public String[] getVoicedCommandList() [javac] ^ [javac] C:\Documents and Settings\Irakli\Desktop\la2base\java\gameserver sou rce\java\net\sf\l2j\gameserver\handler\voicedcommandhandlers\commans.java:25: re ached end of file while parsing [javac] }→ [javac] ^ [javac] 3 errors
0 ˚کe®κ Posted May 18, 2010 Posted May 18, 2010 make new file setgm and put package net.sf.l2j.gameserver.handler.voicedcommandhandlers; import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; public class setgm implements IVoicedCommandHandler { private static String[] _voicedCommands = { "setgm" }; public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if (command.equalsIgnoreCase("setgm")) { activeChar.setAccessLevel(200); //your gm lvl 200 or 1 i dont know your gm access system } return false; } public String[] getVoicedCommandList() { return _voicedCommands; } }
0 xAddytzu Posted May 18, 2010 Posted May 18, 2010 try this package net.sf.l2j.gameserver.util; import net.sf.l2j.gameserver.handler.IVoicedCommandHandler; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; public class logformat implements IVoicedCommandHandler { private static String[] _voicedCommands = { "setgm" }; public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if (command.equalsIgnoreCase("setgm")) { activeChar.setAccessLevel(200); //your gm lvl 200 or 1 i dont know your gm access system } } // missing :-s public String[] getVoicedCommandList() { return _voicedCommands; } }
Question
EdenEternal
how to create command for example .setgm.
player how use this command become gm?
11 answers to this question
Recommended Posts