This commit is contained in:
Remco 2020-11-19 13:26:00 +01:00
commit b01426646a
3 changed files with 17 additions and 5 deletions

View File

@ -74,7 +74,12 @@ public class CommandHandler {
boolean succes = false;
if (command.permission == null || gameClient.getHabbo().hasPermission(command.permission, gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && (gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo())) || gameClient.getHabbo().hasPermission(Permission.ACC_PLACEFURNI) || (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildId() > 0 && gameClient.getHabbo().getHabboInfo().getCurrentRoom().guildRightLevel(gameClient.getHabbo()) >= 2))) {
try {
Emulator.getPluginManager().fireEvent(new UserExecuteCommandEvent(gameClient.getHabbo(), command, parts));
UserExecuteCommandEvent userExecuteCommandEvent = new UserExecuteCommandEvent(gameClient.getHabbo(), command, parts);
Emulator.getPluginManager().fireEvent(userExecuteCommandEvent);
if(userExecuteCommandEvent.isCancelled()) {
return userExecuteCommandEvent.isSuccess();
}
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null)
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new RoomUserTypingComposer(gameClient.getHabbo().getRoomUnit(), false).compose());

View File

@ -15,7 +15,7 @@ public class FreezeLivesComposer extends MessageComposer {
@Override
protected ServerMessage composeInternal() {
this.response.init(Outgoing.FreezeLivesComposer);
this.response.appendInt(this.gamePlayer.getHabbo().getHabboInfo().getId());
this.response.appendInt(this.gamePlayer.getHabbo().getRoomUnit().getId());
this.response.appendInt(this.gamePlayer.getLives());
return this.response;
}

View File

@ -6,15 +6,22 @@ import com.eu.habbo.habbohotel.users.Habbo;
public class UserExecuteCommandEvent extends UserEvent {
public final Command command;
public final String[] params;
private boolean success;
public UserExecuteCommandEvent(Habbo habbo, Command command, String[] params) {
super(habbo);
this.command = command;
this.params = params;
this.success = true;
}
public void setSuccess(boolean success) {
this.success = success;
}
public boolean isSuccess() {
return success;
}
}