Jump to content
  • 0

Itemhandler Command


Question

10 answers to this question

Recommended Posts

  • 0
Posted (edited)
5 hours ago, cyta5 said:

Hello i want to make an item when i click on it to open .gmshop command maybe someone can help me to create it ?

 

6 minutes ago, cyta5 said:

I want to write the command ... when I click it 

So you want to create a command , then create an item and when you click the item you will have to type the command inside the html box?

Why would you want to do that? You are basically tripping yourself for no reason.

Edited by protoftw
  • 0
Posted (edited)

I want one item when I click on it to write the command  .gmshop i want to make that beacuse i have some checkers for example %timeremaining% that's show you how much left to buy the special offer again and at the normal html I see the text %timeremaining% instead the time left....

Edited by cyta5
  • 0
Posted (edited)
9 minutes ago, cyta5 said:

I want one item when I click on it to write the command  .gmshop 

It really sounds nonsense to me. You surely need core-edit to do it. If you wanna do that just for that 1 command then it's not worth it for me. You can try creating an item and when you click on it you can have a combo box for players to select their desired option and confirm it. You can also have your type box but then you will have to explain to your players what they should type in and it's a little confusing if I'm being honest with you..Try creating something simple and as easy as possible.A single clickable item is enough.

 

**

9 minutes ago, cyta5 said:

I want one item when I click on it to write the command  .gmshop i want to make that beacuse i have some checkers for example %timeremaining% that's show you how much left to buy the special offer again and at the normal html I see the text %timeremaining% instead the time left....

You see that because there's something wrong from your side, whether on your html or you haven't implemented it on your code.

Edited by protoftw
  • 0
Posted (edited)

Try this one

 

package com.l2jfrozen.gameserver.handler.itemhandlers;

import com.l2jfrozen.gameserver.handler.IItemHandler;
import com.l2jfrozen.gameserver.handler.VoicedCommandHandler;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;

public class YourClassName implements IItemHandler
{
	private static final int[] ITEM_IDS =
	{
		// your item id here
	};
	private static final String command = "menu"; //change with your command

	@Override
	public void useItem(final L2PlayableInstance playable, final L2ItemInstance item)
	{
		if (!(playable instanceof L2PcInstance))
			return;
		L2PcInstance activeChar = (L2PcInstance) playable;
		VoicedCommandHandler.getInstance().getVoicedCommandHandler(command).useVoicedCommand(command, activeChar, "");
		activeChar.sendMessage("if you want any message.");
	}

	@Override
	public int[] getItemIds()
	{
		return ITEM_IDS;
	}
}

 

 

P.s -> You didnt want to write a command. You wanted to call a command :P

Edited by melron
  • 0
Posted

Just lel. Calling an command via item, bcs why not. 

 

Ps: drop the command and move content to that handler. Otherwise item is a total bullshit as ppl can use the command - if they know it. 

Guest
This topic is now closed to further replies.


  • Posts

    • Thank you very much. It would also be good if you looked into this issue. UnknownSoldier has been manipulating me to make me look bad. He deleted all the evidence I uploaded and left all the insults against me. You'll also see that on April 26th, he reopened the thread and then locked it again just so his friend from Argentina could post: links down :l XD   In the thread: https://maxcheaters.com/topic/253997-sourceservercliente-l2devs-files-l2devscom/page/2/ They do this so they can later tell people that I deleted the links because it was a lie, and so on. Realize that all the damage you're causing is related to this same person. Regards and thank you very much! 🙂 PS: I would like UnknownSoldier to publish the evidence for why he has repeatedly called me a SCAMMER and explain why he also says that to other people. This person is using forum privileges to smear and discredit those who don't work with him. I WANT ALL THE EVIDENCE OF WHAT HE'S SAYING.  
    • Theres a lot of drama going on about Guytis scamming people. I want real, solid proof showing that he scammed anyone attach everything you have.   About reputation: we’re all adults here, yet some are acting like kids fighting over pixels. Think before spreading rumors. False claims don’t make you look better they make you look worse.   I’m waiting for actual evidence that he scammed any user. If there’s nothing to back it up, I’ll deal with it myself. Time’s running out this has been going on long enough.
    • I’ve read the whole topic about Baylee and Protojah. From what I can see, Baylee wanted to buy some htmls and they agreed on a price. Later, Baylee changed her mind and decided not to go through with it. The product wasn’t delivered because Baylee changed her mind. Even if she initially agreed to the price, to avoid confusion. if the files had been sent and payment not made, I would call it a scam. But since they weren’t sent, this isn’t a scam.   I want to stress that I try to be fair to everyone, no matter the situation.   Yeah, Protojah did put in time and effort, and that’s fine, but disagreements happen all the time, even in real life jobs, no matter what the work is. I’m going to lock this topic to avoid more drama. Please keep all personal issues in private messages. And before anyone says anything else I’m not taking sides. I don’t protect scammers and I ban them, but since this isn’t a scam, you both should resolve this situation in DMs.
  • 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..