Lol, and at the point where you name the damages "1,2,3,4" make me laugh
Heres a hit i made for Uber:
PHP Code:#region :hit <user>
case "hit":
case "punch":
{
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
Int32 str = dbClient.ReadInt32("SELECT str FROM users WHERE name = '" + Session.GetHabbo().Username + "'");
Int32 health = dbClient.ReadInt32("SELECT health FROM users WHERE user_id = '" + TargetClient.Id + "'");
{
RoomUser User;
TargetRoom = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
{
if (TargetRoom == null)
{
return false;
}
if (Params[1] == null)
{
Session.SendNotif("Type in a user to perform this action");
return false;
}
TargetClient = UberEnvironment.GetGame().GetClientManager().GetClientByHabbo(Params[1]);
if (TargetClient == null)
{
Session.SendNotif("User : " + Params[1] + " is not in the room!");
return false;
}
User = TargetRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null)
{
return false;
}
Random randNum = new Random();
int hit_dif_0 = randNum.Next(1, 3);
int hit_dif_1 = randNum.Next(1, 13);
int hit = str * hit_dif_0 + hit_dif_1;
User.Chat(Session, "*" + Session.GetHabbo().Username + " swings at " + Params[1] + " causing " + hit + " damage*", false);
{
dbClient.ExecuteQuery("UPDATE users SET health = health - '" + hit + "' WHERE user_id = '" + TargetClient.Id + "' LIMIT 1;");
}
if (health < 1)
{
User.Chat(Session, "*Kills " + Params[1] + "*", false);
ServerMessage response = new ServerMessage(286);
response.AppendBoolean(false);
response.AppendInt32(5);
TargetClient.SendMessage(response);
}
}
if (Params[1] == null)
{
Session.SendNotif(Params[1] + " Is not in your area ");
}
}
}
}
break;
#endregion

