Jump to content

Recommended Posts

Posted

Click the target(player) you wanna give the item press .giveitem id count and voila

/**
* 
*/
package handlers.voicedcommandhandlers;

import java.util.StringTokenizer;

import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

/**
* @author Ventic
*
*/
public class item implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS = { "giveitem" };

@Override
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
{
	if (command.startsWith("giveitem"))
	{
		String val = command.substring(15);
		StringTokenizer st = new StringTokenizer(val);
		int id = Integer.parseInt(st.nextToken());
		int count = Integer.parseInt(st.nextToken());

		L2Object target = activeChar.getTarget();
		if (target == null)
		{
			activeChar.sendMessage("no char found");
			return false;
		}
		else
		{
			activeChar.addItem("Server", id, count, target, true);
			activeChar.sendMessage("Player" +activeChar.getName()+"has given to"+target.getName()+id+count+".");
			return true;
		}
	}
	return true;
}

@Override
public String[] getVoicedCommandList()
{
	return VOICED_COMMANDS;
}
}

 

credits me

 

ps:dont forget to register it

Posted

if as i see its only for gms, the same thing in on admin panel then its like useless..

Posted

if as i see its only for gms, the same thing in on admin panel then its like useless..

normal players can use it too
Posted

if (command.startsWith("giveitem") && activeChar.isGM())

yes sorry i forgot it by mistake and i forgot it to remove it
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

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