[PlusEMU] Gate opens for specific rank

Michell

god x
Nov 15, 2011
151
22
Hi.

I want a piece of furni (in this case Sci-Fi door) to open for a specific rank. I put this:

In GameMap.cs

if (HasCorrectRank)
{
Item I = Items.FirstOrDefault(x => x.GetBaseItem().ItemName.ToLower().Equals("scifidoor*6"));
if (I != null)
{
if (User.GetClient() == null || User.GetClient().GetHabbo() == null)
return false;

if (User.GetClient().GetHabbo().Rank == 9)
{
I.InteractingUser = User.GetClient().GetHabbo().Id;
I.ExtraData = "1";
I.UpdateState(false, true);

I.RequestUpdate(4, true);

return true;
}
else
{
if (User.Path.Count > 0)
User.Path.Clear();
User.PathRecalcNeeded = false;
return false;
}
}
}
}


GameMap.cs 2/2
/*
* 0 = blocked
* 1 = open
* 2 = last step
* 3 = door
* */

List<Item> Items = _room.GetGameMap().GetAllRoomItemForSquare(To.X, To.Y);
if (Items.Count > 0)
{
bool HasGroupGate = Items.ToList().Where(x => x.GetBaseItem().InteractionType == InteractionType.GUILD_GATE).ToList().Count() > 0;
bool HasCorrectRank = Items.ToList().Where(x => x.GetBaseItem().ItemName.ToLower().Equals("scifidoor*6")).ToList().Count() > 0;
if (HasGroupGate)
{

As you can see I'm using it the way the group gates would open to. The problem is:

Rank 7 can walk over the gate, others ranks cannot, but I must manually open the gate by double clicking it first, I want that it opens automatically when you click the tile on the other side of the gate. Like the way a groupgate works.[/spoiler][/spoiler][/spoiler][/spoiler]
 

Users who are viewing this thread

Top