Jump to content

Question

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

You have to store your running task to a ScheduledFuture<?> _task (stored in L2PcInstance / Player) and then

 

        if (_task != null)
        {
            _task.cancel(false);
            _task = null;
        }

 

over it if you need to abort it. That code section can be put in a public method to be triggered anywhere, anytime. You got over 50+ occurrences on any regular L2J pack of that way of coding.

Edited by Tryskell
  • Like 1
  • 0
Posted

The task still runs silently in background.

 

While the task is only few dozens of seconds and is barely exploitable, it's not a good practice. Using that type of logic will pown you, one day or another.

  • 0
Posted (edited)

Simplest solution. Before you do revive, make a zone check.. Sounds obvious, right.

 

Whatever you like. Could be assigned to some method, variable as suggested. But it's not like it's a must, nor the whole code is super duper. Keep it simple stupid.

Edited by SweeTs

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...