Command :rob [Plus aka. Bios Emulator]

onepoint

New Member
May 6, 2014
2
0
I have create a roleplay command with this you can rob a user.

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:

Pollak

Active Member
Oct 12, 2017
161
51
Good xddd ;) But it was only you to change "Bios" to "Plus" and BiosEmuThiago to "PlusEnvironment".
 

Gang67

|Jump out gang, we jump out those vehicles|
May 5, 2017
303
54
I have create a roleplay command with this you can rob a user.

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
Should make the random integer range be between the actual amount the target user has not just a constant range so the target doesn’t have to have more than 4000 for it to work
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
Yikes

No cooldown for users to get robbed
No variable to determine if the user was successful at robbing
 

Users who are viewing this thread

Top