public static void addFlagToPlayer(L2PcInstance _player)
{
//remove items from the player hands (right, left, both)
// This is NOT a BUG, I don't want them to see the icon they have 8D
L2ItemInstance wpn = _player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
if (wpn == null)
{
wpn = _player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
if (wpn != null)
_player.getInventory().unEquipItemInBodySlotAndRecord(Inventory.PAPERDOLL_RHAND);
}
else
{
_player.getInventory().unEquipItemInBodySlotAndRecord(Inventory.PAPERDOLL_RHAND);
wpn = _player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND);
if (wpn != null)
_player.getInventory().unEquipItemInBodySlotAndRecord(Inventory.PAPERDOLL_LHAND);
}
//add the flag in his hands
_player.getInventory().equipItem(ItemTable.getInstance().createItem("", CTF._FLAG_IN_HAND_ITEM_ID, 1, _player, null));
_player.broadcastPacket(new SocialAction(_player.getObjectId(), 16)); //amazing glow
_player._haveFlagCTF = true;
_player.broadcastUserInfo();
_player.sendPacket(new CreatureSay(_player.getObjectId(), 15, ":", "You got it! Run back! ::")); // 8D
}
public static void removeFlagFromPlayer(L2PcInstance player)
{
final L2ItemInstance wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
player._haveFlagCTF = false;
if (wpn != null)
{
final L2ItemInstance[] unequiped = player.getInventory().unEquipItemInBodySlotAndRecord(wpn.getItem().getBodyPart());
player.getInventory().destroyItemByItemId("", CTF._FLAG_IN_HAND_ITEM_ID, 1, player, null);
InventoryUpdate iu = new InventoryUpdate();
for (L2ItemInstance element : unequiped)
iu.addModifiedItem(element);
player.sendPacket(iu);
player.sendPacket(new ItemList(player, true)); // get your weapon back now ...
player.abortAttack();
player.broadcastUserInfo();
}
else
{
player.getInventory().destroyItemByItemId("", CTF._FLAG_IN_HAND_ITEM_ID, 1, player, null);
player.sendPacket(new ItemList(player, true)); // get your weapon back now ...
player.abortAttack();
player.broadcastUserInfo();
}
}
Launch of the New Top Servers Platform
We are pleased to announce the official launch of our new Top Servers platform — a space designed for administrators and communities to publish, promote, and grow their servers with complete freedom and transparency.
🔗 Direct Access:
https://www.united-extreme.com/u3games/topservers
This project was created with a clear goal: to offer a fair and open system where every server can gain the visibility it deserves thanks to player support.
🔥 Key Features:
Voting every 24 hours available for both registered and guest users.
Integrated CAPTCHA system to ensure votes are legitimate and free of bot interference.
Configurable external links — ideal for reward panels or other associated platforms.
No intrusive advertising: all servers compete under equal conditions.
Advanced user dashboard to easily manage and update published servers.
Real rate system, differentiating user and guest votes.
Organic promotion from the U3Games community, which exceeds 25,000 daily visits, providing real visibility.
Here, every server has the opportunity to grow, stand out, and build a strong community without limitations. We invite you to be part of this new stage. Publish your server, make it visible, and let the players decide.
Welcome to the new generation of tops — welcome to U3Games Top Servers.
Question
l2redkiller
i got some errors in ctf event engine :
thannkss for help
if need the code :
public static void addFlagToPlayer(L2PcInstance _player) { //remove items from the player hands (right, left, both) // This is NOT a BUG, I don't want them to see the icon they have 8D L2ItemInstance wpn = _player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND); if (wpn == null) { wpn = _player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND); if (wpn != null) _player.getInventory().unEquipItemInBodySlotAndRecord(Inventory.PAPERDOLL_RHAND); } else { _player.getInventory().unEquipItemInBodySlotAndRecord(Inventory.PAPERDOLL_RHAND); wpn = _player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND); if (wpn != null) _player.getInventory().unEquipItemInBodySlotAndRecord(Inventory.PAPERDOLL_LHAND); } //add the flag in his hands _player.getInventory().equipItem(ItemTable.getInstance().createItem("", CTF._FLAG_IN_HAND_ITEM_ID, 1, _player, null)); _player.broadcastPacket(new SocialAction(_player.getObjectId(), 16)); //amazing glow _player._haveFlagCTF = true; _player.broadcastUserInfo(); _player.sendPacket(new CreatureSay(_player.getObjectId(), 15, ":", "You got it! Run back! ::")); // 8D } public static void removeFlagFromPlayer(L2PcInstance player) { final L2ItemInstance wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND); player._haveFlagCTF = false; if (wpn != null) { final L2ItemInstance[] unequiped = player.getInventory().unEquipItemInBodySlotAndRecord(wpn.getItem().getBodyPart()); player.getInventory().destroyItemByItemId("", CTF._FLAG_IN_HAND_ITEM_ID, 1, player, null); InventoryUpdate iu = new InventoryUpdate(); for (L2ItemInstance element : unequiped) iu.addModifiedItem(element); player.sendPacket(iu); player.sendPacket(new ItemList(player, true)); // get your weapon back now ... player.abortAttack(); player.broadcastUserInfo(); } else { player.getInventory().destroyItemByItemId("", CTF._FLAG_IN_HAND_ITEM_ID, 1, player, null); player.sendPacket(new ItemList(player, true)); // get your weapon back now ... player.abortAttack(); player.broadcastUserInfo(); } }14 answers to this question
Recommended Posts