2018-07-06 15:30:00 +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.users.Habbo;
|
|
|
|
|
|
|
|
public class FastwalkCommand extends Command
|
|
|
|
{
|
|
|
|
public FastwalkCommand()
|
|
|
|
{
|
|
|
|
super("cmd_fastwalk", Emulator.getTexts().getValue("commands.keys.cmd_fastwalk").split(";"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean handle(GameClient gameClient, String[] params) throws Exception
|
|
|
|
{
|
|
|
|
if(gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null)
|
|
|
|
{
|
2019-05-04 04:06:12 +02:00
|
|
|
if(gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
|
|
|
if (gameClient.getHabbo().getHabboInfo().getRiding() != null) //TODO Make this an event plugin which fires that can be cancelled
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-07-06 15:30:00 +02:00
|
|
|
Habbo habbo = gameClient.getHabbo();
|
|
|
|
|
|
|
|
if(params.length >= 2)
|
|
|
|
{
|
|
|
|
String username = params[1];
|
|
|
|
|
|
|
|
habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(username);
|
|
|
|
|
|
|
|
if(habbo == null)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
habbo.getRoomUnit().setFastWalk(!habbo.getRoomUnit().isFastWalk());
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|