MasterJiq
Member
- Jul 8, 2016
- 385
- 23
Hello,
this is my second command that I make it by my own, so who have rank same to '2' or above '2' will receive this message as Hotel Alert. This is easy to code but I am not gonna wasting my time by doing the things that will make nothing to me.
VipAlertCommand.cs:
Then go to CommandManager.cs and search for:
and below that add this:
After that run this SQL:
Thanks.
I think in the last return would be 'return true;' ?
this is my second command that I make it by my own, so who have rank same to '2' or above '2' will receive this message as Hotel Alert. This is easy to code but I am not gonna wasting my time by doing the things that will make nothing to me.
VipAlertCommand.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.User.Fun
{
class VipAlertCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_vipalert"; }
}
public string Parameters
{
get { return "%message%"; }
}
public string Description
{
get { return "Send a message to all users who has VIP."; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Please enter a message to send.");
return;
}
if (Session.GetHabbo().Rank < 2)
{
Session.SendWhisper("Seems like you're not VIP. Please buy VIP before using special commands.");
return;
}
if (Session.GetHabbo().Rank >= 2)
{
string Message = CommandManager.MergeParams(Params, 1);
PlusEnvironment.GetGame().GetClientManager().SendMessage(new BroadcastMessageAlertComposer(Message + "\r\n" + "- " + Session.GetHabbo().Username));
return;
}
}
}
}
Then go to CommandManager.cs and search for:
Code:
private void RegisterVIP() {
Code:
this.Register("vipalert", VipAlertCommand());
After that run this SQL:
Code:
INSERT INTO `permissions_commands` VALUES ('command_vipalert', '2', '0');
Thanks.
I think in the last return would be 'return true;' ?