Plus Emulator Habboon Edit Commands
Hi, I've been trying to code commands into boon's plus edit, and whenever i go onto the client it just says it as regular speech?
now, I thought this was because the command wasn't registered somewhere but i'm quite sure everything is where it's supposed to be.
Not familiar with this edit yet anyways,
Here is my command,
Code:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.GameClients;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;
namespace Plus.HabboHotel.Rooms.Chat.Commands.User.Fun
{
class dropkickcommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_dropkick"; }
}
public string Parameters
{
get { return "%username%"; }
}
public string Description
{
get { return "Dropkick another user"; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Please enter the username of the person you want to dropkick.");
return;
}
GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
if (TargetClient == null)
{
Session.SendWhisper("The user was not found in the room.");
return;
}
RoomUser TargetUser = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
if (TargetUser == null)
{
Session.SendWhisper("An error occured while finding that user, maybe they're offline or not in this room.");
}
if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
{
Session.SendWhisper("You cannot dropkick yourself!");
return;
}
TargetUser.Statusses.Add("sit", "1.0");
TargetUser.UpdateNeeded = true;
Room.SendMessage(new ChatComposer(TargetUser.VirtualId, "Dropkicks " + TargetClient.GetHabbo().Username + "*", 0, TargetUser.LastBubble));
}
}
}
and here is what it does,
http://i.imgur.com/oZsFXyr.png
Now, I have no idea if this command is coded correctly for this emulator,
just starting to get use to the edit.
@Jonteh @Sledmore
Thanks,
Re: Plus Emulator Habboon Edit Commands
CommandManager.cs
Under
Code:
private void RegisterUser()
add
Code:
this.Register("dropkick", new dropkickcommand());
Re: Plus Emulator Habboon Edit Commands
Quote:
Originally Posted by
Jonteh
CommandManager.cs
Under
Code:
private void RegisterUser()
add
Code:
this.Register("dropkick", new dropkickcommand());
Hey, I already have this added,
still doesn't work.
Re: Plus Emulator Habboon Edit Commands
Have you added "command_dropkick" to "permissions_commands"
Re: Plus Emulator Habboon Edit Commands
Quote:
Originally Posted by
Jonteh
Have you added "command_dropkick" to "permissions_commands"
Yes i have, with group_id and subscription_id as 1,
no luck.
Re: Plus Emulator Habboon Edit Commands
All my group_ids are 0 for my coded commands.
Re: Plus Emulator Habboon Edit Commands
Quote:
Originally Posted by
Jonteh
All my group_ids are 0 for my coded commands.
I've changed it to that, aswell as 0 and 0
still does not work.
Re: Plus Emulator Habboon Edit Commands
Well, here is an example of one of my commands. Maybe you can spot the difference, I sure can't. If there even is one. Sorry I can't help.
Code:
class InventoryCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_inventory"; }
}
public string Parameters
{
get { return ""; }
}
public string Description
{
get { return "Displays your character inventory."; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
StringBuilder Inv = new StringBuilder();
Inv.Append("User Inventory for " + Session.GetHabbo().Username + "\r");
Inv.Append("----------------------------\r");
if (Session.GetHabbo().Roleplay.OwnedWeapons.Count >= 1)
{
foreach (Weapon Weapon in Session.GetHabbo().Roleplay.OwnedWeapons)
{
Inv.Append(Weapon.InventoryAmount + " " + Weapon.WeaponName + "" + (Weapon.InventoryAmount > 1 ? "s" : "") + " " + (Weapon.IsRanged ? "with " + (Weapon.AmmoClip + Weapon.AmmoInventory) + " Total Ammo" : "") + "\r");
}
}
else
{
Inv.Append("You have no owned weapons.");
}
Session.SendMessage(new MOTDNotificationComposer(Inv.ToString()));
}
}
Re: Plus Emulator Habboon Edit Commands
Quote:
Originally Posted by
Jonteh
Well, here is an example of one of my commands. Maybe you can spot the difference, I sure can't. If there even is one. Sorry I can't help.
Code:
class InventoryCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_inventory"; }
}
public string Parameters
{
get { return ""; }
}
public string Description
{
get { return "Displays your character inventory."; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
StringBuilder Inv = new StringBuilder();
Inv.Append("User Inventory for " + Session.GetHabbo().Username + "\r");
Inv.Append("----------------------------\r");
if (Session.GetHabbo().Roleplay.OwnedWeapons.Count >= 1)
{
foreach (Weapon Weapon in Session.GetHabbo().Roleplay.OwnedWeapons)
{
Inv.Append(Weapon.InventoryAmount + " " + Weapon.WeaponName + "" + (Weapon.InventoryAmount > 1 ? "s" : "") + " " + (Weapon.IsRanged ? "with " + (Weapon.AmmoClip + Weapon.AmmoInventory) + " Total Ammo" : "") + "\r");
}
}
else
{
Inv.Append("You have no owned weapons.");
}
Session.SendMessage(new MOTDNotificationComposer(Inv.ToString()));
}
}
It's alright, thanks anyways :)
- - - Updated - - -
I have fixed this,
turns out to make the user sit it has to be the following,
Code:
TargetUser.Statusses.Add("sit", "1.0");
TargetUser.Z -= 0.35;
TargetUser.isSitting = true;
TargetUser.UpdateNeeded = true;
Thanks :)