Hey Community
i'll release a fix for the battleball puck .
just insert this Code to room.cs
Code:
if (Item.GetBaseItem().Name == "bb_puck")
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
string color = dbClient.ReadString("SELECT bb_ball FROM `users` WHERE id='" + User.HabboId + "'");
int state;
string ColorBase = "";
state = dbClient.ReadInt32("SELECT bb_state FROM `room_items` WHERE id = '" + Item.Id + "' LIMIT 1");
{
if (color == "r")
if (state == 0)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '1'");
}
else if (state == 1)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '2'");
}
else if (state == 2)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '3'");
}
else if (state == 3)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '4'");
}
ServerMessage Baldosa = new ServerMessage(88);
Baldosa.AppendStringWithBreak(Item.Id.ToString());
Baldosa.AppendStringWithBreak(ColorBase);
SendMessage(Baldosa);
Item.UpdateState(true, true);
}
{
if (color == "b")
if (state == 0)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '5'");
}
else if (state == 5)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '6'");
}
else if (state == 6)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '7'");
}
else if (state == 7)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '8'");
}
ServerMessage Baldosa = new ServerMessage(88);
Baldosa.AppendStringWithBreak(Item.Id.ToString());
Baldosa.AppendStringWithBreak(ColorBase);
SendMessage(Baldosa);
Item.UpdateState(true, true);
}
{
if (color == "g")
if (state == 0)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '9'");
}
else if (state == 9)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '10'");
}
else if (state == 10)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '11'");
}
else if (state == 11)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '12'");
}
ServerMessage Baldosa = new ServerMessage(88);
Baldosa.AppendStringWithBreak(Item.Id.ToString());
Baldosa.AppendStringWithBreak(ColorBase);
SendMessage(Baldosa);
Item.UpdateState(true, true);
}
{
if (color == "b")
if (state == 0)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '13'");
}
else if (state == 13)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '14'");
}
else if (state == 14)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '15'");
}
else if (state == 15)
{
ColorBase = "0";
dbClient.ExecuteQuery("UPDATE `room_items` SET bb_state = '16'");
}
ServerMessage Baldosa = new ServerMessage(88);
Baldosa.AppendStringWithBreak(Item.Id.ToString());
Baldosa.AppendStringWithBreak(ColorBase);
SendMessage(Baldosa);
Item.UpdateState(true, true);
}
}
-Now add at interaction_type a column called -Find at your Furniture table the bb_puck furni
(sprite id=3641 at my db) and change the column to ball.
-Last stepp , Debug your Uberemu and have fun with the news Puck ;)
Credits:
- 95% Kekomondo (Spanish Forum)
- 5% Me (Taylan ) translating & releasing the fix at Ragezone ;)