I want to add a restriction that the player need a item to go in portal and I did that:
if (Session.Character.Inventory.CountItem(1400) <= 0) // Not working
WHat Im doing wrong?
========[The code:]========
if (portal.DestinationMapId == 189)
{
if (Session.Character.PrestigeLevel < 1)
{
Session.SendPacket(UserInterfaceHelper.GenerateMsg ("You need atleast prestige 1 to go in there!", 10));
return;
}
else
{
if (Session.Character.Inventory.CountItem(1400) <= 0) // Not working
{
Session.SendPacket(UserInterfaceHelper.GenerateMsg ("You need to craft the key of Prestige Lobby first or reach Prestige 1!", 10));
return;
}
else
{
ServerManager.Instance.ChangeMap(Session.Character .CharacterId, 189, 42, 161);
}
}
}