[HELP] Plusemu R2 add commands

Results 1 to 4 of 4
  1. #1
    Member DtcLucas is offline
    MemberRank
    Mar 2014 Join Date
    75Posts

    ! [HELP] Plusemu R2 add commands

    First of all, i'm from the Netherlands so sorry for my bad english.
    English:

    Hello Ragezone

    I use the plus emulator R2, the massgive & globalgive command are not in my emulator, so i want to add this. But when i am debugging my emulator, it gives the next error: https://prnt.sc/fs1ben

    What did i do?
    First of all, i had download an another plusemu, and i set the command files to my emulator.
    Screen: https://prnt.sc/fs18n3
    Then i have in the commandmanager.cs add my new commands: https://prnt.sc/fs197f

    What did i do wrong? Or what do i missing?
    For people who will see my files:
    Globalgive:
    PHP-code:
    using System.Linq;
    using Plus.Communication.Packets.Outgoing.Inventory.Purse;
    using Plus.Database.Interfaces;
    using Plus.HabboHotel.GameClients;

    namespace
    Plus.HabboHotel.Rooms.Chat.Commands.Moderator
    {
    internal class GlobalGiveCommand : IChatCommand
    {
    public string PermissionRequired
    {
    get { return "command_global_currency"; }
    }

    public string Parameters
    {
    get { return "%type% %amount%"; }
    }

    public string Description
    {
    get { return "Update currencies for everyone in your database."; }
    }

    public void Execute(GameClient session, Room room, string[] Params)
    {
    if (Params.Length == 1)
    {
    session.SendWhisper("Please enter a currency type! (coins, duckets, diamonds, gotw)");
    return;
    }

    string updateVal = Params[1];
    switch (updateVal.ToLower())
    {
    case "coins":
    case "credits":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_coins"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
    {
    client.GetHabbo().Credits += amount;
    client.SendMessage(new CreditBalanceComposer(client.GetHabbo().Credits));
    }
    using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
    {
    dbClient.RunQuery("UPDATE users SET credits = credits + " + amount);
    }
    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }
    case "pixels":
    case "duckets":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_pixels"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
    {
    client.GetHabbo().Duckets += amount;
    client.SendMessage(new HabboActivityPointNotificationComposer(
    client.GetHabbo().Duckets, amount));
    }
    using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
    {
    dbClient.RunQuery("UPDATE users SET activity_points = activity_points + " + amount);
    }
    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }
    case "diamonds":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_diamonds"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
    {
    client.GetHabbo().Diamonds += amount;
    client.SendMessage(new HabboActivityPointNotificationComposer(client.GetHabbo().Diamonds,
    amount,
    5));
    }
    using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
    {
    dbClient.RunQuery("UPDATE users SET vip_points = vip_points + " + amount);
    }
    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }
    case "gotw":
    case "gotwpoints":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_gotw"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
    {
    client.GetHabbo().GOTWPoints = client.GetHabbo().GOTWPoints + amount;
    client.SendMessage(new HabboActivityPointNotificationComposer(client.GetHabbo().GOTWPoints,
    amount, 103));
    }
    using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
    {
    dbClient.RunQuery("UPDATE users SET gotw_points = gotw_points + " + amount);
    }
    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }
    }
    }
    }
    }



    Massgive:
    PHP-code:
    using System.Linq;
    using Plus.Communication.Packets.Outgoing.Inventory.Purse;
    using Plus.HabboHotel.GameClients;

    namespace
    Plus.HabboHotel.Rooms.Chat.Commands.Moderator
    {
    class MassGiveCommand : IChatCommand
    {
    public string PermissionRequired
    {
    get { return "command_mass_give"; }
    }

    public string Parameters
    {
    get { return "%type% %amount%"; }
    }

    public string Description
    {
    get { return ""; }
    }

    public void Execute(GameClient session, Room room, string[] Params)
    {
    if (Params.Length == 1)
    {
    session.SendWhisper("Please enter a currency type! (coins, duckets, diamonds, gotw)");
    return;
    }

    var updateVal = Params[1];
    switch (updateVal.ToLower())
    {
    case "coins":
    case "credits":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_coins"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList().Where(client => client?.GetHabbo() != null && client.GetHabbo().Username != session.GetHabbo().Username))
    {
    client.GetHabbo().Credits = client.GetHabbo().Credits += amount;
    client.SendMessage(new CreditBalanceComposer(client.GetHabbo().Credits));

    if (client.GetHabbo().Id != session.GetHabbo().Id)
    client.SendNotification(session.GetHabbo().Username + " has given you " + amount +
    " Credit(s)!");
    session.SendWhisper("Successfully given " + amount + " Credit(s) to " +
    client.GetHabbo().Username + "!");
    }

    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }

    case "pixels":
    case "duckets":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_pixels"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList().Where(client => client?.GetHabbo() != null && client.GetHabbo().Username != session.GetHabbo().Username))
    {
    client.GetHabbo().Duckets += amount;
    client.SendMessage(new HabboActivityPointNotificationComposer(
    client.GetHabbo().Duckets, amount));

    if (client.GetHabbo().Id != session.GetHabbo().Id)
    client.SendNotification(session.GetHabbo().Username + " has given you " + amount +
    " Ducket(s)!");
    session.SendWhisper("Successfully given " + amount + " Ducket(s) to " +
    client.GetHabbo().Username + "!");
    }
    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }

    case "diamonds":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_diamonds"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList().Where(client => client?.GetHabbo() != null && client.GetHabbo().Username != session.GetHabbo().Username))
    {
    client.GetHabbo().Diamonds += amount;
    client.SendMessage(new HabboActivityPointNotificationComposer(client.GetHabbo().Diamonds,
    amount,
    5));

    if (client.GetHabbo().Id != session.GetHabbo().Id)
    client.SendNotification(session.GetHabbo().Username + " has given you " + amount +
    " Diamond(s)!");
    session.SendWhisper("Successfully given " + amount + " Diamond(s) to " +
    client.GetHabbo().Username + "!");
    }

    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }

    case "gotw":
    case "gotwpoints":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_gotw"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList().Where(client => client?.GetHabbo() != null && client.GetHabbo().Username != session.GetHabbo().Username))
    {
    client.GetHabbo().GOTWPoints = client.GetHabbo().GOTWPoints + amount;
    client.SendMessage(new HabboActivityPointNotificationComposer(client.GetHabbo().GOTWPoints,
    amount, 103));

    if (client.GetHabbo().Id != session.GetHabbo().Id)
    client.SendNotification(session.GetHabbo().Username + " has given you " + amount +
    " GOTW Point(s)!");
    session.SendWhisper("Successfully given " + amount + " GOTW point(s) to " +
    client.GetHabbo().Username + "!");
    }
    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }
    default:
    session.SendWhisper("'" + updateVal + "' is not a valid currency!");
    break;
    }
    }
    }
    }



    Thanks for help.
    Kind regards,
    Lucas

    Netherlands:

    Hallo Ragezone,
    Ik gebruik de plus emulator R2, de massgive & globalgive command zitten hier niet in bij mij, dus ik wil deze toevoegen, maar wanneer ik mijn emulator debug krijg ik de volgende error: https://prnt.sc/fs1ben

    Wat heb ik gedaan?
    Ik heb als 1e de command bestanden uit een andere plusemulator gehaald en in de map van mijn emu gezet.
    Screen: https://prnt.sc/fs18n3
    Daarna heb ik in de commandmanager.cs de commands toegevoegd: https://prnt.sc/fs197f
    Zoals je ziet bij 'moderator' net als waar ik de commands heb toegevoegd.

    Wat moet er nog gedaan worden, of wat doe ik fout? Laat het aub weten.
    Voor de mensen die de file willen zien:
    Globalgive:
    PHP-code:
    using System.Linq;
    using Plus.Communication.Packets.Outgoing.Inventory.Purse;
    using Plus.Database.Interfaces;
    using Plus.HabboHotel.GameClients;

    namespace
    Plus.HabboHotel.Rooms.Chat.Commands.Moderator
    {
    internal class GlobalGiveCommand : IChatCommand
    {
    public string PermissionRequired
    {
    get { return "command_global_currency"; }
    }

    public string Parameters
    {
    get { return "%type% %amount%"; }
    }

    public string Description
    {
    get { return "Update currencies for everyone in your database."; }
    }

    public void Execute(GameClient session, Room room, string[] Params)
    {
    if (Params.Length == 1)
    {
    session.SendWhisper("Please enter a currency type! (coins, duckets, diamonds, gotw)");
    return;
    }

    string updateVal = Params[1];
    switch (updateVal.ToLower())
    {
    case "coins":
    case "credits":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_coins"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
    {
    client.GetHabbo().Credits += amount;
    client.SendMessage(new CreditBalanceComposer(client.GetHabbo().Credits));
    }
    using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
    {
    dbClient.RunQuery("UPDATE users SET credits = credits + " + amount);
    }
    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }
    case "pixels":
    case "duckets":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_pixels"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
    {
    client.GetHabbo().Duckets += amount;
    client.SendMessage(new HabboActivityPointNotificationComposer(
    client.GetHabbo().Duckets, amount));
    }
    using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
    {
    dbClient.RunQuery("UPDATE users SET activity_points = activity_points + " + amount);
    }
    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }
    case "diamonds":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_diamonds"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
    {
    client.GetHabbo().Diamonds += amount;
    client.SendMessage(new HabboActivityPointNotificationComposer(client.GetHabbo().Diamonds,
    amount,
    5));
    }
    using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
    {
    dbClient.RunQuery("UPDATE users SET vip_points = vip_points + " + amount);
    }
    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }
    case "gotw":
    case "gotwpoints":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_gotw"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
    {
    client.GetHabbo().GOTWPoints = client.GetHabbo().GOTWPoints + amount;
    client.SendMessage(new HabboActivityPointNotificationComposer(client.GetHabbo().GOTWPoints,
    amount, 103));
    }
    using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
    {
    dbClient.RunQuery("UPDATE users SET gotw_points = gotw_points + " + amount);
    }
    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }
    }
    }
    }
    }



    Massgive:
    PHP-code:
    using System.Linq;
    using Plus.Communication.Packets.Outgoing.Inventory.Purse;
    using Plus.HabboHotel.GameClients;

    namespace
    Plus.HabboHotel.Rooms.Chat.Commands.Moderator
    {
    class MassGiveCommand : IChatCommand
    {
    public string PermissionRequired
    {
    get { return "command_mass_give"; }
    }

    public string Parameters
    {
    get { return "%type% %amount%"; }
    }

    public string Description
    {
    get { return ""; }
    }

    public void Execute(GameClient session, Room room, string[] Params)
    {
    if (Params.Length == 1)
    {
    session.SendWhisper("Please enter a currency type! (coins, duckets, diamonds, gotw)");
    return;
    }

    var updateVal = Params[1];
    switch (updateVal.ToLower())
    {
    case "coins":
    case "credits":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_coins"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList().Where(client => client?.GetHabbo() != null && client.GetHabbo().Username != session.GetHabbo().Username))
    {
    client.GetHabbo().Credits = client.GetHabbo().Credits += amount;
    client.SendMessage(new CreditBalanceComposer(client.GetHabbo().Credits));

    if (client.GetHabbo().Id != session.GetHabbo().Id)
    client.SendNotification(session.GetHabbo().Username + " has given you " + amount +
    " Credit(s)!");
    session.SendWhisper("Successfully given " + amount + " Credit(s) to " +
    client.GetHabbo().Username + "!");
    }

    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }

    case "pixels":
    case "duckets":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_pixels"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList().Where(client => client?.GetHabbo() != null && client.GetHabbo().Username != session.GetHabbo().Username))
    {
    client.GetHabbo().Duckets += amount;
    client.SendMessage(new HabboActivityPointNotificationComposer(
    client.GetHabbo().Duckets, amount));

    if (client.GetHabbo().Id != session.GetHabbo().Id)
    client.SendNotification(session.GetHabbo().Username + " has given you " + amount +
    " Ducket(s)!");
    session.SendWhisper("Successfully given " + amount + " Ducket(s) to " +
    client.GetHabbo().Username + "!");
    }
    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }

    case "diamonds":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_diamonds"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList().Where(client => client?.GetHabbo() != null && client.GetHabbo().Username != session.GetHabbo().Username))
    {
    client.GetHabbo().Diamonds += amount;
    client.SendMessage(new HabboActivityPointNotificationComposer(client.GetHabbo().Diamonds,
    amount,
    5));

    if (client.GetHabbo().Id != session.GetHabbo().Id)
    client.SendNotification(session.GetHabbo().Username + " has given you " + amount +
    " Diamond(s)!");
    session.SendWhisper("Successfully given " + amount + " Diamond(s) to " +
    client.GetHabbo().Username + "!");
    }

    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }

    case "gotw":
    case "gotwpoints":
    {
    if (!session.GetHabbo().GetPermissions().HasCommand("command_give_gotw"))
    {
    session.SendWhisper("Oops, it appears that you do not have the permissions to use this command!");
    break;
    }
    int amount;
    if (int.TryParse(Params[2], out amount))
    {
    foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList().Where(client => client?.GetHabbo() != null && client.GetHabbo().Username != session.GetHabbo().Username))
    {
    client.GetHabbo().GOTWPoints = client.GetHabbo().GOTWPoints + amount;
    client.SendMessage(new HabboActivityPointNotificationComposer(client.GetHabbo().GOTWPoints,
    amount, 103));

    if (client.GetHabbo().Id != session.GetHabbo().Id)
    client.SendNotification(session.GetHabbo().Username + " has given you " + amount +
    " GOTW Point(s)!");
    session.SendWhisper("Successfully given " + amount + " GOTW point(s) to " +
    client.GetHabbo().Username + "!");
    }
    break;
    }
    session.SendWhisper("Oops, that appears to be an invalid amount!");
    break;
    }
    default:
    session.SendWhisper("'" + updateVal + "' is not a valid currency!");
    break;
    }
    }
    }
    }



    Alvast bedankt.
    Met vriendelijke groet,
    Lucas


  2. #2
    Member DtcLucas is offline
    MemberRank
    Mar 2014 Join Date
    75Posts

    Re: [HELP] Plusemu R2 add commands

    Anyone?

  3. #3
    Proficient Member spreedblood is offline
    MemberRank
    May 2014 Join Date
    165Posts

    Re: [HELP] Plusemu R2 add commands

    Right-click over the error code and it will suggest you to implement a namespace, do that....

    Skickat från min FRD-L09 via Tapatalk

  4. #4
    Member DtcLucas is offline
    MemberRank
    Mar 2014 Join Date
    75Posts

    Re: [HELP] Plusemu R2 add commands

    @spreedblood i have it fixed, but the command doesn't work



Advertisement