[PLUSEMU] VIP Teleport

MasterJiq

Member
Jul 8, 2016
385
23
Hello,

I am willing to release my first command (make by my own without requesting any help). This teleport function only can be used in your rooms or rooms that you have rights even the owner is not you.

VipTeleCommand.cs:
Code:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

using Plus.HabboHotel.Rooms;
using Plus.Communication.Packets.Outgoing.Rooms.Notifications;

namespace Plus.HabboHotel.Rooms.Chat.Commands.User.Fun
{
    class VipTeleCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get { return "command_viptele"; }
        }

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

        public string Description
        {
            get { return "The ability to teleport anywhere only in your room/if you have rights."; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (User == null)
                return;

            if (Session.GetHabbo().Rank < 2)
            {
                Session.SendWhisper("Seems like you're not VIP. Please buy VIP before using special commands.");
                return;
            }

            bool HasRights = false;
            if (Room.CheckRights(Session, false, true))
                HasRights = true;

            if (!HasRights)
            {
                Session.SendWhisper("Seems like you're not owner of this room. Please request for right to teleport.");
                return;
            }

            User.TeleportEnabled = !User.TeleportEnabled;
            Room.GetGameMap().GenerateMaps();
        }
    }
}

and then go to CommandManager.cs search for this:
Code:
private void RegisterVIP() {
below that add this:
Code:
this.Register("viptele", VipTeleCommand());

Done. Add this sql if you wan't to make it better (I think)
Code:
INSERT INTO `permissions_commands` VALUES ('command_viptele', '2', '0');

Thanks.
 

cain

insert html
May 12, 2012
180
74
A lot of users on my hotel requested this on my hotel good to see it released, nice.
 

Users who are viewing this thread

Top