[HELP/REQUEST] Rank command for PlusEMU R63B

Joshie

WebHost Founder
May 29, 2015
143
20
Hi, I'm looking for instructions aswell as the code on how to install the ":rank x" command for plsu emu r63b
 

mcmatters

Member
Dec 2, 2014
195
6
Code:
using Plus.Database.Interfaces;
using Plus.HabboHotel.GameClients;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator
{
    public class RankCommand : IChatCommand
    {
        public string PermissionRequired
    {
        get { return "command_rank"; }
    }

    public string Parameters
    {
        get { return "%username% %rank%"; }
    }

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

    public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
    {
        if (Params.Length != 2)
        {
            Session.SendWhisper(":rank %username% %rank%");
            return;
        }

        GameClient Target = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
        if (Target == null)
        {
            Session.SendWhisper("Oops, couldn't find that user!");
            return;
        }
            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("UPDATE `users` SET `rank`=@rank WHERE `id` = '" + Target.GetHabbo().Id + "' LIMIT 1");
                dbClient.AddParameter("rank", Params[2]);
                dbClient.RunQuery();
            }
            Target.GetHabbo().Rank = Convert.ToInt32(Params[2]);
            Session.SendWhisper("Successfully set "+Target.GetHabbo().Username+"'s rank to: "+Params[2]);
        }
}
}
 

RyanSu

New Member
Dec 12, 2016
8
3
Code:
using Plus.Database.Interfaces;
using Plus.HabboHotel.GameClients;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator
{
    public class RankCommand : IChatCommand
    {
        public string PermissionRequired
    {
        get { return "command_rank"; }
    }

    public string Parameters
    {
        get { return "%username% %rank%"; }
    }

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

    public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
    {
        if (Params.Length != 2)
        {
            Session.SendWhisper(":rank %username% %rank%");
            return;
        }

        GameClient Target = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
        if (Target == null)
        {
            Session.SendWhisper("Oops, couldn't find that user!");
            return;
        }
            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("UPDATE `users` SET `rank`=@rank WHERE `id` = '" + Target.GetHabbo().Id + "' LIMIT 1");
                dbClient.AddParameter("rank", Params[2]);
                dbClient.RunQuery();
            }
            Target.GetHabbo().Rank = Convert.ToInt32(Params[2]);
            Session.SendWhisper("Successfully set "+Target.GetHabbo().Username+"'s rank to: "+Params[2]);
        }
}
}
so i done this and when i do ;rank x they just repeated the same msg
 

Users who are viewing this thread

Top