Jump to content
  • 0

"player" Cannot Be Resolved


Question

Posted

Script if someone need it, make all GrandBoss Chaotic Zone http://www.lineager.su/always-pvp-status-in-boss-zone/

 

Someone know why got this error? Thanks guys.

 

Error

 

1449250944_error.png

 

PvpFlagTaskManager.java

/**
 * Updates and clears PvP flag of {@link L2PcInstance} after specified time.
 * @author Tryskell, Hasha
 */
public final class PvpFlagTaskManager implements Runnable
{
    private final Map<L2PcInstance, Long> _players = new ConcurrentHashMap<>();
    
    public static final PvpFlagTaskManager getInstance()
    {
        return SingletonHolder._instance;
    }
    
    protected PvpFlagTaskManager()
    {
        // Run task each second.
        ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(this, 1000, 1000);
    }
    
    /**
     * Adds {@link L2PcInstance} to the PvpFlagTask.
     * @param player : L2PcInstance to be added and checked.
     * @param time : Time in ms, after which the PvP flag is removed.
     */
    public final void add(L2PcInstance player, long time)
    {
        _players.put(player, System.currentTimeMillis() + time);
    }
    
    /**
     * Removes {@link L2PcInstance} from the PvpFlagTask.
     * @param player : {@link L2PcInstance} to be removed.
     */
    public final void remove(L2PcInstance player)
    {
        _players.remove(player);
    }
    
    @Override
    public final void run()
    {
        // List is empty, skip.
        if (_players.isEmpty())
            return;
        
        // Get current time.
        final long currentTime = System.currentTimeMillis();
        
        // Loop all players.
        for (Iterator<Map.Entry<L2PcInstance, Long>> iterator = _players.entrySet().iterator(); iterator.hasNext();)
        {
            // Get entry of current iteration.
            Map.Entry<L2PcInstance, Long> entry = iterator.next();
            
            // Get time left and check.
            final long timeLeft = entry.getValue();
            
            if (_players.isInsideZone(ZoneId.BOSS))
            entry.setValue(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);

            
            // Time is running out, clear PvP flag and remove from list.
            if (currentTime > timeLeft)
            {
                entry.getKey().updatePvPFlag(0);
                iterator.remove();
            }
            // Time almost runned out, update to blinking PvP flag.
            else if (currentTime > (timeLeft - 5000))
                entry.getKey().updatePvPFlag(2);
            // Time didn't run out, keep PvP flag.
            else
                entry.getKey().updatePvPFlag(1);
        }
    }
    
    private static class SingletonHolder
    {
        protected static final PvpFlagTaskManager _instance = new PvpFlagTaskManager();
    }
}
Modificar mensaje

3 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Hey everyone, I'm selling this mod that took me two weeks to create and adapt for L2JACIS 401. The mod works by using a collar item that I've included. Clicking on it will mount your pet directly. It doesn't replace or break the textures of the original raiders. Here are a couple of screenshots to illustrate how each mount works. Each mount uses a different item, each with its own ID, texture, etc.   https://ibb.co/S4b5PzFc https://ibb.co/pjsrj1qQ   Besides the lion, I'm also adding these mounts.   https://ibb.co/q3Z54mcL https://ibb.co/hJv8Sz2N     Cheers!
    • Add some share links, would be nice for people that still looking for them!
    • Please do not insult anybody and respect other works. Do not have hateful behaviour, last warning.
    • You cant add cloaks on interlude packs, is possible to find ones but will never work correct on character.
    • Hello everyone, want to sell some of my custom features in my server, someone might be interested. Collections: (50euro) - you need ingredients (min/max) - can you choose enchant level  - reward : custom skills Enemy Inventory and stats checker: (25euro) - you can check what is your enemy wearing - how much is it enchanted - you can see his detailed info about stats - pvp/pk/rebirth/pve dmg etc anything can be added Gamble (random craft item) - (50 euro)  - by using command .gamble - windown will pop up  - name of the item / chances / % of your points / maximum you can have shows  - you can buy instantly points / or item can be made for that  - each pack can have different prices/items  - refresh give another 5 random items. Custom Enchant System: (20euro)  - target all grades - one scroll can be used for any grade  - increaseEnchantby / decreaseEnchantBy Custom Rotated Farm Zone: (50euro)  - players will be automaticly flagged when enter / unflagged when leave  - you can make any zone like that  - you can add any restriction you want or dont.  - Rotation will be announced in Global  Chat  - in zone drop will be increased by 30% - or you can modify by config  - maybe you want zone where they need lets say 10x Enter to enter can be done - i can give you code, or i can also implement for you - if you want some other custom code, and im able to do it you can ask me discord:expllo#8222 or just expllo - if you won't find, message me here.  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..