Jump to content
  • 0

Voiced command help :S


Question

Posted

Hello guys. I want to make a voice command like: .sendgmmsg hi guys what's up?

i mean you know a command, and the rest a String value, but it doesnt work properly :S any idea how to make it? It works as an admin command though...

Recommended Posts

  • 0
Posted

What do you need exactly lol, explain it a bit if you expect help :/

 

Global message to each online player? But via pm.. htm window.. system message or what.

  • 0
Posted

Well i want to make just a command like: .message Hello guys

And i want this "Hello Guys" to appear to everyone... but i think something with the tokens is the problem.. as i saw in one of my files, i found this:

 

StringTokenizer st = new StringTokenizer(target);

 

But if i am write, i have to make like 15 tokens? and i dont think its gonna work anyway...

  • 0
Posted

so all player can use this and spam ? how should this be useful ?

or the command can use only admin/gm chars ? but then is still the question for what is it useful :s

  • 0
Posted

As message, but if its possible to make it in the middle of the screen, no problem but its interlude so i dont think its working...

I dont mind also if its made with HTML, like a box in a html and then a submit button..

  • 0
Posted

1) ExShowScreenMessage (not a huge deal to put it in IL)

2) Broadcast..

3) Announcements..

 

(If you are facing problems with the structure of the code, you could take a few ideas from the //announce admincommand. But you can't expect us to give you the ready code. "We're here to help you, not open your server"! ;))

  • 0
Posted

I dont really have a problem man, look first i made it as admin command, and it works great. But when i made it as voiced command, it doesnt work... it doesnt read the message... plus, to put ExShowScreenMessage, you  need to put something in System if i am right, and seriously no one is gonna download files... :S I just want to make: .sendmessage hello people, and send "hello people" to everyone. I used CreatureSay for that.. but doesnt work on Voiced command! only works on admin command...

  • 0
Posted

1) You have to modify the parse method. Right now, the voiced handler is getting as:

handlerMap.get(command); etc

if you write .sendMessage bla bla bla, obviously, the command wont equals to the voiced handler name

you should change to

String start = command.split(" ");
if(start.lenght < 2) return null;
handlerMap.get(start[0]);

Then, in the voiced handler, forget about String target, just use command.split(" ");

 

  • 0
Posted

this is a test i made after see that the voiced commands in interlude alredy support parameters for them.

Screen:

shot00000kz.jpg

Code:

Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Test.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Test.java	(revision 0)
+++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Test.java	(revision 0)
@@ -0,0 +1,50 @@
+/* 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 2, 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
+
+import net.sf.l2j.gameserver.clientpackets.Say2;
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.serverpackets.CreatureSay;
+
+/**
+ *
+ * @author  BiggBoss
+ */
+public class Test implements IVoicedCommandHandler
+{
+	private static final String[] COMMAND = {"test"};
+	
+	/**
+	 * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()
+	 */
+	public String[] getVoicedCommandList()
+	{
+		return COMMAND;
+	}
+
+	/**
+	 * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
+	 */
+	public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+	{
+		final CreatureSay say = new CreatureSay(activeChar.getObjectId(), Say2.SHOUT, activeChar.getName(), target);
+		activeChar.broadcastPacket(say);
+		return false;
+	}
+}
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java	(revision 4462)
+++ java/net/sf/l2j/gameserver/GameServer.java	(working copy)
@@ -196,6 +196,7 @@
import net.sf.l2j.gameserver.handler.usercommandhandlers.OlympiadStat;
import net.sf.l2j.gameserver.handler.usercommandhandlers.PartyInfo;
import net.sf.l2j.gameserver.handler.usercommandhandlers.Time;
+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Test;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats;
import net.sf.l2j.gameserver.idfactory.IdFactory;
@@ -589,6 +590,7 @@

		_voicedCommandHandler = VoicedCommandHandler.getInstance();
		_voicedCommandHandler.registerVoicedCommandHandler(new stats());
+		_voicedCommandHandler.registerVoicedCommandHandler(new Test());

		if(Config.L2JMOD_ALLOW_WEDDING)
			_voicedCommandHandler.registerVoicedCommandHandler(new Wedding());

Guest
This topic is now closed to further replies.


  • Posts

    • Hi, could someone please share a C1 L2 Off cheat code for local play?
    • I’ve worked with a web designer Tacoma before, and it really reminded me how much smoother projects run when design and development stay in sync. Your setup looks solid, and pairing clean UI work with steady backend support can save a ton of back‑and‑forth later. If you ever decide to push harder on conversions or need outside perspective on structure, that mix helped me spot gaps early on.
    • If you’re juggling mixed payment methods and tricky setups, I’ve found that easing the pressure on the subscription side can make the whole flow smoother. I started using Subscription Revenue Growth for handling my own recurring payments, upgrades, and all that messy churn stuff, and it took a big weight off. Pairing something stable for subs with your gateway setup can keep cashflow from going off the rails.
    • L2Avalon launches February 20 High Five project (Salvation client) focused on classic world progression — not instance spam and not “twink” metas. What is L2Avalon? L2Avalon is built around real Lineage 2 gameplay: farming spots, open world conflict, raids, epics, economy and competition. No Kamael Reduced instanced content **Discord:** https://discord.gg/NbM2cXmAem 🌐 **Website:** https://l2avalon.net Balance & Economy Every class is tuned to be viable in PvE and PvP Off-meta classes get buffed instead of adding power-creep garbage Adena-based economy Farming matters: boosted Drop/Spoil for each stage of progression Rates & Settings Dynamic XP: 50x (Lv 1–40) → 1x (Lv 78+) Staged progression with new content unlocking weekly Adena / Drop / Spoil: 3x / 5x / 5x NPC Buffer: 2 hours (Premium: 3 hours) Box limit: 2+1 windows per PC MP potion: 1000 MP, 10s cooldown Free2Play System (earn Donate Coins by playing) You don’t have to donate to progress. Donate Coins drop in-game, so everything is achievable through playtime and activity. Where Donate Coins drop: Mobs Lv 76+, Raid Bosses Lv 70+, Epic Bosses Auto-farm (controlled) Limit: only 1 window can use auto-farm at the same time Daily time: 1 hour/day without Premium Extra tickets: purchasable with PC Bang points (earned by being online) Disabled zones: CC / IT / FOG / VARKA / KETRA Equipment Changes Reworked set bonuses Reworked SA system Enchanted set bonuses Enchanted shirt bonuses Fake Epic jewelry (weakened alternative) Skills (High Five mechanics) New skills added Old skills updated New enchant branches + updated existing ones Subclass skills Clan skills Daily Activities (solo-friendly) Events / Missions / Instances Stages Soon — stage schedule and weekly unlocks will be published February 20 — we start. **Discord:** https://discord.gg/NbM2cXmAem 🌐 **Website:** https://l2avalon.net
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..

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