diff --git a/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql b/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql index 21b6af39..960943ef 100644 --- a/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql +++ b/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql @@ -33,6 +33,9 @@ INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.flood.mute.time', INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.jukebox.limit.large', '20'); INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.jukebox.limit.normal', '10'); +-- Background Toner Scripter Warning +INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('scripter.warning.item.bgtoner.permission', '%username% tried to change the background toner without rights in %room% owned by %owner%'); + -- Table structure for room_trax DROP TABLE IF EXISTS `room_trax`; CREATE TABLE `room_trax` ( diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBackgroundToner.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBackgroundToner.java index c74e91aa..813ce782 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBackgroundToner.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBackgroundToner.java @@ -3,6 +3,7 @@ package com.eu.habbo.habbohotel.items.interactions; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.items.Item; +import com.eu.habbo.habbohotel.modtool.ScripterManager; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; @@ -60,6 +61,16 @@ public class InteractionBackgroundToner extends HabboItem { if(client != null) { + if (!client.getHabbo().getRoomUnit().getRoom().hasRights(client.getHabbo())) { + ScripterManager.scripterDetected( + client, + Emulator.getTexts().getValue("scripter.warning.item.bgtoner.permission").replace("%username%", client.getHabbo().getHabboInfo().getUsername()) + .replace("%room%", room.getName()) + .replace("%owner%", room.getOwnerName()) + ); + return; + } + if (client.getHabbo().getRoomUnit().cmdSit && client.getHabbo().getRoomUnit().getEffectId() == 1337) { new BackgroundAnimation(this, room).run(); return;