Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P trunk2
- Index: gameserver/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java
- ===================================================================
- --- gameserver/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java (revision 910)
- +++ gameserver/head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java (working copy)
- @@ -79,6 +79,7 @@
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminRes;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminRideWyvern;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminScript;
- +import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminSetTeam;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminShop;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminShutdown;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminSiege;
- @@ -185,6 +186,7 @@
- registerAdminCommandHandler(new AdminNoble());
- registerAdminCommandHandler(new AdminBuffs());
- registerAdminCommandHandler(new AdminAio());
- + registerAdminCommandHandler(new AdminSetTeam());
- //ATTENTION: adding new command handlers, you have to change the
- //sql file containing the access levels rights
- Index: gameserver/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminSetTeam.java
- ===================================================================
- --- gameserver/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminSetTeam.java (revision 0)
- +++ gameserver/head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminSetTeam.java (revision 0)
- @@ -0,0 +1,62 @@
- +package com.l2jfrozen.gameserver.handler.admincommandhandlers;
- +
- +import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
- +import com.l2jfrozen.gameserver.model.L2Object;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +
- +/**
- + *
- + * @author Elfocrash
- + */
- +public class AdminSetTeam implements IAdminCommandHandler
- +{
- + private static String[] _adminCommands =
- + {
- + "admin_setteam1", "admin_setteam2", "admin_clearteam"
- + };
- +
- + @Override
- + public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- +
- + L2Object target = activeChar.getTarget();
- +
- + if(activeChar.getTarget() instanceof L2PcInstance)
- + {
- +
- +
- + if(command.startsWith("admin_setteam1"))
- + {
- + ((L2PcInstance) activeChar.getTarget()).setTeam(1);
- + ((L2PcInstance) activeChar.getTarget()).sendMessage(activeChar.getName() + " selected you to be in the blue team");
- + ((L2PcInstance) activeChar.getTarget()).broadcastUserInfo();
- + }
- + else if(command.startsWith("admin_setteam2"))
- + {
- + ((L2PcInstance) activeChar.getTarget()).setTeam(2);
- + ((L2PcInstance) activeChar.getTarget()).sendMessage(activeChar.getName() + " selected you to be in the red team");
- + ((L2PcInstance) activeChar.getTarget()).broadcastUserInfo();
- + }
- + else if(command.startsWith("admin_clearteam"))
- + {
- + ((L2PcInstance) activeChar.getTarget()).setTeam(0);
- + ((L2PcInstance) activeChar.getTarget()).sendMessage("Your team has been cleared from " + activeChar.getName());
- + ((L2PcInstance) activeChar.getTarget()).broadcastUserInfo();
- + }
- + }
- + else
- + {
- + activeChar.sendMessage("Hey!! This is only for players!");
- + return false;
- + }
- + return true;
- + }
- +
- +
- +
- + @Override
- + public String[] getAdminCommandList()
- + {
- + return _adminCommands;
- + }
- +}
- INSERT INTO `admin_command_access_rights` VALUES ('admin_setteam1','3');
- INSERT INTO `admin_command_access_rights` VALUES ('admin_setteam2','3');
- INSERT INTO `admin_command_access_rights` VALUES ('admin_clearteam','3');
Advertisement
Add Comment
Please, Sign In to add comment