[Plus Emu] ;ha Problem

xFlyx

New Member
Jan 29, 2018
21
4
Hey, the Problem: I say ;ha Message and he does not send him...
I always get: "Not a Staff!"

-> Here is the HotelAlertCommand.cs
Code:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

using Plus.Communication.Packets.Outgoing.Moderation;

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

        public string Parameters
        {
            get { return "%mensaje%"; }
        }

        public string Description
        {
            get { return "Message to all Users."; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Session.GetHabbo().Rank > 4)
            {
                if (Params.Length == 1)
                {
                    Session.SendWhisper("Please add a Message. ");
                    return;
                }
                int OnlineUsers = PlusEnvironment.GetGame().GetClientManager().Count;
                int RoomCount = PlusEnvironment.GetGame().GetRoomManager().Count;

                string Message = CommandManager.MergeParams(Params, 1);
                PlusEnvironment.GetGame().GetClientManager().SendMessage(new BroadcastMessageAlertComposer(Message + "\n\n<b>Informações do CoreEmulador</b>:\n" +
                     "Users Online: " + OnlineUsers + "\n" +
                     "Rooms Loadet: " + RoomCount + "\r\n" + "- " + Session.GetHabbo().Username));

                return;
            }
            else
            {
                Session.SendWhisper("Not a Staff!");
                return;
            }
        }
    }
}
Can u help me? Thank u! (Sry, bad english...)
 

xFlyx

New Member
Jan 29, 2018
21
4
Yes, i have edit the code in:
Code:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

using Plus.Communication.Packets.Outgoing.Moderation;

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

        public string Parameters
        {
            get { return "%mensaje%"; }
        }

        public string Description
        {
            get { return "Send a message to the entire hotel."; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length == 1)
            {
                Session.SendWhisper("Please enter a message to send.");
                return;
            }

            string Message = CommandManager.MergeParams(Params, 1);
            PlusEnvironment.GetGame().GetClientManager().SendMessage(new BroadcastMessageAlertComposer(Message + "\r\n" + "- " + Session.GetHabbo().Username));
                            
            return;
        }
    }
}

it works :)
 

Jerry

not rly active lol
Jul 8, 2013
1,957
522
I don’t understand why you’d force code a certain rank to use a specific command when you can just edit the permission for the command in the permissions_commands table?
 

Users who are viewing this thread

Top