Jump to content

[Share] Admin award all players


Recommended Posts

Hello people.

 

Since i helped a guy here  "http://www.maxcheaters.com/forum/index.php?topic=126391.0" with the same issue, i decided to share

the admin command //mass_create. How it works? You type //mass_create itemID amount (e.g //mass_create 57 1 -> This will add 1 adena to every online player)

 

Tested in L2J Interlude and works fine.

 

package net.sf.l2j.gameserver.handler.admincommandhandlers;

import java.util.StringTokenizer;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.datatables.ItemTable;
import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
import net.sf.l2j.gameserver.model.GMAudit;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.serverpackets.ItemList;
import net.sf.l2j.gameserver.templates.L2Item;



public class AdminMassCreate implements IAdminCommandHandler {
private static final String[] ADMIN_COMMANDS = { "admin_mass_create" };
private static final int REQUIRED_LEVEL = Config.GM_CREATE_ITEM; // you need the same access level as create_item.

public boolean useAdminCommand(String command, L2PcInstance activeChar) {
	if (!Config.ALT_PRIVILEGES_ADMIN) {
		if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM()))
			return false;
	}

	GMAudit.auditGMAction(activeChar.getName(), command, (activeChar.getTarget() != null?activeChar.getTarget().getName():"no-target"), "");

	if (command.startsWith("admin_mass_create")) {
		try {
			String val = command.substring(17);
			StringTokenizer st = new StringTokenizer(val);
			if (st.countTokens() == 2) {
				String id = st.nextToken();
				int idval = Integer.parseInt(id);
				String num = st.nextToken();
				int numval = Integer.parseInt(num);
				massCreate(activeChar, idval, numval);
			} else if (st.countTokens() == 1) {
				String id = st.nextToken();
				int idval = Integer.parseInt(id);
				massCreate(activeChar, idval, 1);
			}
		} catch (StringIndexOutOfBoundsException e) {
			activeChar.sendMessage("Usage: //itemcreate <itemId> [amount]");
		} catch (NumberFormatException nfe) {
			activeChar.sendMessage("Specify a valid number.");
		}
	}
	return true;
}

private void massCreate(L2PcInstance activeChar, int idval, int numval) {
	for (L2PcInstance _players : L2World.getInstance().getAllPlayers()) {
		if (_players == activeChar)
			continue;

		_players.getInventory().addItem("Admin", idval, numval, _players,
				null);

		ItemList il = new ItemList(_players, true);
		_players.sendPacket(il);
		_players.sendMessage("Admin award you " + numval
				+ " item(s) number " + idval);

		activeChar.sendMessage("You have spawned " + numval
				+ " item(s) number " + idval + " in all chars inventory.");
	}

}

public String[] getAdminCommandList() {
	return ADMIN_COMMANDS;
}

private boolean checkLevel(int level) {
	return (level >= REQUIRED_LEVEL);
}
}

 

 

Link to comment
Share on other sites

its not your work ...

its shared by down !

 

Please give me a link or something so i can know if i'll lock this topic or not.

Link to comment
Share on other sites

Hello people.

 

Since i helped a guy here  "http://www.maxcheaters.com/forum/index.php?topic=126391.0" with the same issue, i decided to share

the admin command //mass_create. How it works? You type //mass_create itemID amount (e.g //mass_create 57 1 -> This will add 1 adena to every online player)

 

Tested in L2J Interlude and works fine.

 

package net.sf.l2j.gameserver.handler.admincommandhandlers;

 

import java.util.StringTokenizer;

 

import net.sf.l2j.Config;

import net.sf.l2j.gameserver.datatables.ItemTable;

import net.sf.l2j.gameserver.handler.IAdminCommandHandler;

import net.sf.l2j.gameserver.model.GMAudit;

import net.sf.l2j.gameserver.model.L2World;

import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

import net.sf.l2j.gameserver.serverpackets.ItemList;

import net.sf.l2j.gameserver.templates.L2Item;

 

 

 

public class AdminMassCreate implements IAdminCommandHandler {

private static final String[] ADMIN_COMMANDS = { "admin_mass_create" };

private static final int REQUIRED_LEVEL = Config.GM_CREATE_ITEM; // you need the same access level as create_item.

 

public boolean useAdminCommand(String command, L2PcInstance activeChar) {

if (!Config.ALT_PRIVILEGES_ADMIN) {

if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM()))

return false;

}

 

GMAudit.auditGMAction(activeChar.getName(), command, (activeChar.getTarget() != null?activeChar.getTarget().getName():"no-target"), "");

 

if (command.startsWith("admin_mass_create")) {

try {

String val = command.substring(17);

StringTokenizer st = new StringTokenizer(val);

if (st.countTokens() == 2) {

String id = st.nextToken();

int idval = Integer.parseInt(id);

String num = st.nextToken();

int numval = Integer.parseInt(num);

massCreate(activeChar, idval, numval);

} else if (st.countTokens() == 1) {

String id = st.nextToken();

int idval = Integer.parseInt(id);

massCreate(activeChar, idval, 1);

}

} catch (StringIndexOutOfBoundsException e) {

activeChar.sendMessage("Usage: //itemcreate <itemId> [amount]");

} catch (NumberFormatException nfe) {

activeChar.sendMessage("Specify a valid number.");

}

}

return true;

}

 

private void massCreate(L2PcInstance activeChar, int idval, int numval) {

for (L2PcInstance _players : L2World.getInstance().getAllPlayers()) {

if (_players == activeChar)

continue;

 

_players.getInventory().addItem("Admin", idval, numval, _players,

null);

 

ItemList il = new ItemList(_players, true);

_players.sendPacket(il);

_players.sendMessage("Admin award you " + numval

+ " item(s) number " + idval);

 

activeChar.sendMessage("You have spawned " + numval

+ " item(s) number " + idval + " in all chars inventory.");

}

 

}

 

public String[] getAdminCommandList() {

return ADMIN_COMMANDS;

}

 

private boolean checkLevel(int level) {

return (level >= REQUIRED_LEVEL);

}

}

 

 

 

 

Fail

Link to comment
Share on other sites

Well, are you stupid or something ? Lighto helped a guy in this topic and he just shared the full code here so anyone can use it! he didn't say, WHOA IT IS UNIQUE, YOU CAN'T FIND IT ANYWHERE!

 

 

Here is the link with the guy he helped http://www.maxcheaters.com/forum/index.php?topic=126391.0"

 

You people seriously are soo dumb. Before you post something, think. It isn't difficult nor painfull. Really :)

Link to comment
Share on other sites

Please give me a link or something so i can know if i'll lock this topic or not.

 

http://www.maxcheaters.com/forum/index.php?topic=126391.0;msg=884695

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • Welcome to my store :https://ultrasstore11.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10.50 $ 2017 Discord Account :4.99 $ 2018 Discord Account : 3.99 $ 2019 Discord Account : 2.99 $ 2020 Discord Account :1.99$ 2021 Discord Account :1.50$ 2022 Discord Account :0.99$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord :@ultrasstore11 Telegram : https://t.me/ultrastore11 Whatsapp ; +212614849119
    • Trying to add a Heal Over Time to flame and frost armor skills since Archmage & Spellslinger dont get a leech skill. I figured I would try to just add params in the skill xmls but the server dont like that at ALL the way I tried it. Anyone know if this is even possible?
    • Hi), we are searching dev for IL buff shop code. 
    • Im sorry you paid for something that is in a config file....   # --------------------------------------------------------------------------- # Premium Drop Configuration # These rates will be applied to premium char if AutoLoot in Drops.ini is TRUE # otherwise might create some exploits with pickup action # --------------------------------------------------------------------------- # General drop multiplier if item id is NOT in PrRateDropItemsById list PremiumRateDropItems = 2 # Specific multipliers for items, if you add one items in this list will # bypass PremiumRateDropItems # TIP: if you have one item id in Rates.ini for example 57,20 # This rate will multiply 20 * your number here so be carefull PrRateDropItemsById = 57,2;40002,2     This is inside PremiumService.ini, the yellow text above are the (itemID,DropMultiplier) you can separate items with semicolon. like in most of the .ini files. I should add that the above .ini file is in a hi5 pack so for aCis and other revisions Im not sure if its the same.
  • Topics

×
×
  • 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