onepoint
New Member
- May 6, 2014
- 2
- 0
I have create a roleplay command with this you can rob a user.
SQL QUERY: INSERT INTO permissions_commands VALUES ('command_raub', '1', '0');
This command works together with the afk command.
Sorry for my english, I'm from germany ^^.
Best regards
- Nightmare
Code:
/*
* CommandManager.cs
*/
this.Register("raub", new RaubCommand()); // Coded by Nightmare
Code:
/*
Create a RaubCommand.cs and insert this
*/
using System;
using Bios.HabboHotel.GameClients;
using Bios.Communication.Packets.Outgoing.Rooms.Chat;
using Bios.Communication.Packets.Outgoing.Inventory.Purse;
using Bios.Communication.Packets.Outgoing.Rooms.Avatar;
namespace Bios.HabboHotel.Rooms.Chat.Commands.User.Fun
{
class RaubCommand : IChatCommand
{
public string PermissionRequired => "command_raub";
public string Parameters => "[USARIO]";
public string Description => "Beklaue ein User";
public void Execute(GameClient Session, Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Bitte geben Sie den Usernamen ein!");
return;
}
GameClient Target = BiosEmuThiago.GetGame().GetClientManager().GetClientByUsername(Params[1]);
if (Target == null)
{
Session.SendWhisper("Entschuldigung, wir haben diesen Benutzer nicht gefunden!");
return;
}
else
{
RoomUser TargetID = Room.GetRoomUserManager().GetRoomUserByHabbo(Target.GetHabbo().Id);
RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (TargetID == null)
{
Session.LogsNotif("Entschuldigung, der Benutzer ist nicht im Raum!", "command_notification");
return;
}
else if (Target.GetHabbo().Username == Session.GetHabbo().Username)
{
Session.SendWhisper("Du kannst dich nicht selber beklauen.");
Room.SendMessage(new ChatComposer(User.VirtualId, "Helft dieser verwirrten Maus, sie möchte sich selbst beklauen!", 0, 34));
return;
}
RoomUser Habbo = Room.GetRoomUserManager().GetRoomUserByHabbo(Target.GetHabbo().Id);
else if (Habbo.IsAsleep != true) {
Session.LogsNotif("Der Benutzer hat den Schutz aktiviert!", "command_notification");
return;
}
else
{
if (User != null)
{
if ((Math.Abs((int)(TargetID.X - User.X)) < 2) && (Math.Abs((int)(TargetID.Y - User.Y)) < 2))
{
RoomUser Habbo = Room.GetRoomUserManager().GetRoomUserByHabbo(Target.GetHabbo().Id);
if (Habbo.IsAsleep == false) {
if (Target.GetHabbo().Credits >= 4000)
{
Random rnd = new Random();
int random = rnd.Next(300, 3000);
int Amount = random;
Target.GetHabbo().Credits = Target.GetHabbo().Credits -= Amount;
Target.SendMessage(new CreditBalanceComposer(Target.GetHabbo().Credits));
Session.GetHabbo().Credits = Session.GetHabbo().Credits += Amount;
Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
Room.SendMessage(new ChatComposer(User.VirtualId, " Du hast ihm " + Amount + " Taler geklaut ", 0, 16));
Room.SendMessage(new ChatComposer(TargetID.VirtualId, "Dir wurden " + Amount + " Taler geklaut ", 0, 16));
}
else
{
Session.SendWhisper("Der User ist pleite.");
}
}
else
{
Session.SendWhisper("Der User ist im AFK Modus du kannst ihn nicht beklauen.");
}
}
else
{
Session.SendWhisper("Hoppla!Der Benutzer ist nicht in Ihrer Nähe.!");
return;
}
}
}
}
}
}
}
SQL QUERY: INSERT INTO permissions_commands VALUES ('command_raub', '1', '0');
This command works together with the afk command.
Sorry for my english, I'm from germany ^^.
Best regards
- Nightmare
Last edited: