Most visitors online was 12720 , on 2 May 2024
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature currently requires accessing the site using the built-in Safari browser.
package admincommands;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.utils.chathandlers.AdminCommand;
public class Testt extends AdminCommand {
public Testt() {
super("Testt");
}
@Override
public void execute(Player admin, String... params) {
Player target = null;
VisibleObject creature = admin.getTarget();
if (admin.getTarget() instanceof Player) {
target = (Player) creature;
} if (target == null) {
PacketSendUtility.sendMessage(admin, "You should select a target first!");
return;
} if (params.length < 2) {
PacketSendUtility.sendMessage(admin, "You should enter Value!");
return;
}
String paramValue = params[1];
if (params[0].equals("block")) {
if (admin.getAccessLevel() < CommandsConfig.SET) {
PacketSendUtility.sendMessage(admin, "You dont have enough rights to execute this command");
return;
}
int index;
try {
index = Integer.parseInt(paramValue);
catch (NumberFormatException ex) {
PacketSendUtility.sendMessage(admin, "Wrong input");
return;
}
catch (Exception ex2) {
PacketSendUtility.sendMessage(admin, "Error.");
return;
}
player.getGameStats().setStat(StatEnum.BLOCK, admin.getGameStats().getStatBonus(StatEnum.BLOCK) * paramValue);
}
}
}
}
So can you guys tell me what is wrong with my code?