2020-05-16 15:35:20 +02:00
|
|
|
package com.eu.habbo.habbohotel.commands;
|
|
|
|
|
|
|
|
import com.eu.habbo.Emulator;
|
|
|
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
|
|
|
import com.eu.habbo.habbohotel.permissions.Permission;
|
|
|
|
import com.eu.habbo.habbohotel.rooms.Room;
|
2020-06-03 03:15:09 +02:00
|
|
|
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
2020-05-16 15:35:20 +02:00
|
|
|
import com.eu.habbo.habbohotel.users.Habbo;
|
|
|
|
|
|
|
|
public class SoftKickCommand extends Command {
|
|
|
|
public SoftKickCommand() {
|
|
|
|
super("cmd_softkick", Emulator.getTexts().getValue("commands.keys.cmd_softkick").split(";"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
2020-06-03 03:15:09 +02:00
|
|
|
if (params.length == 2) {
|
|
|
|
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
|
2020-05-16 15:35:20 +02:00
|
|
|
|
2020-06-03 03:15:09 +02:00
|
|
|
if (habbo == null) {
|
|
|
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.keys.cmd_softkick_error").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT);
|
|
|
|
return true;
|
2020-05-16 15:35:20 +02:00
|
|
|
}
|
2020-06-03 03:15:09 +02:00
|
|
|
else if (habbo == gameClient.getHabbo()) {
|
|
|
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.keys.cmd_softkick_error_self"), RoomChatMessageBubbles.ALERT);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
|
|
|
room.kickHabbo(habbo, false);
|
|
|
|
}
|
|
|
|
}
|
2020-05-16 15:35:20 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|