Jump to content

Question

Posted

Hello there, can somebody help me and give me a clue how i could make the following case?

 

While a player is in jail,  he cant target nothing (NPC's,other players, summons etc etc)

 

-Freya Client

11 answers to this question

Recommended Posts

  • 0
Posted

yea, but this way player wont be able to target players who are in jail. I want to make him cant target anything, anywhere...(Just to make it simple, i dont want it for jail, i want it for one of my conditions, so i though this jail thingy will clean things for you).

 

P.S: I want it if player.isInEvent can't target anything.....

 

FREYA CLIENT

try onAction packet you may have better results

  • 0
Posted (edited)

Basically you have to add a check @ onTarget method, like if target instanceof L2Playable || L2NpcInstance then return. Ofc you need a check about the zone first if isInsideZone(ZoneId.JAIL) or w/e method is on your pack (probably frozen) :P

 

better!

 

Do not spam.

Edited by SweeTs
  • 0
Posted (edited)

Basically you have to add a check @ onTarget method, like if target instanceof L2Playable || L2Summon then return. Ofc you need a check about the zone first if isInsideZone(ZoneId.JAIL) or w/e method is on your pack (probably frozen) :P

 

 

Do not spam.

 

I tried to this one but nothing...

 

public void setTarget(L2Object object)
{
+    if (this instanceof L2PcInstance)
+     {
+          L2PcInstance p = (L2PcInstance)this;
+           if (p.isInJail())
+          {
+                return;
+         }
+     }
     if (object != null && !object.isVisible())
         object = null;
 
    if (object != null && object != _target)
    {
         getKnownList().addKnownObject(object);
         object.getKnownList().addKnownObject(this);
     }
     _target = object;
}
 
 
L2Character.java
Edited by Medisept
  • 0
Posted (edited)
if (object instanceof L2PcInstance && object.isInsideZone(ZoneId.JAIL))
   return;

If so

Edited by SweeTs
  • 0
Posted
if (object instanceof L2PcInstance && object.isInsideZone(ZoneId.JAIL))
   return;

If so

 

 

 

yea, but this way player wont be able to target players who are in jail. I want to make him cant target anything, anywhere...(Just to make it simple, i dont want it for jail, i want it for one of my conditions, so i though this jail thingy will clean things for you).

 

P.S: I want it if player.isInEvent can't target anything.....

 

FREYA CLIENT

  • 0
Posted (edited)

Yup, I just cleaned your example.

 

Add w/e instance you want to (block) that check :P

Edited by SweeTs
Guest
This topic is now closed to further replies.


  • Posts

    • someone ban again this piece of shit this guy is a virus we should make an antikara or karabytes
    • 🍂 The cost on Vibe-sms is dropping, like autumn leaves falling from the trees.     It’s a little sad to watch the last days of summer fade away with its warmth, but that’s how the world works  every season has its own rules. The same goes for our prices: they are gradually but steadily going down, opening up new opportunities and great deals. 💸   🌍 USA is already at the minimum, and Europe, Asia, and dozens of other countries will follow soon. Don’t miss out  fresh rates are waiting for you!   Website link — https://vibe-sms.net/ Our Telegram channel — https://t.me/vibe_sms
    • You didn't tell me anywhere that you wanted core.jar as proof, I have everything ready for an independent developer to review. All the conversations, all your edits. I won't settle anything with you, so you can threaten me again and damage my name.
    • So what? Did i say anything wrong? You have no idea what source/compile is. I still wait for your .jar or source to be posted since you say i destroyed the compiled version of yours. Why you don't post it? Are you afraid that people will just see few addon lines and you did not even know that your source and compiled had different things? I should not even waste 2 minute to fix your raidboss_spawnlist thing.    Your mentally ill. What you posted is our primary deal nothing against me.  Because all he does is post whatever i write as if i hide and i did not say any mod to join and check my discord. i want him actual post something against me or any offenses i did. I also requested him several hours ago to post his .jar where my code "HACKED" his server but he wont post.    Nobody should allow open a random topic and cause issues to other's life without proofs. I demand punishment and soon unless he post evidence that i hurt his server or left him or did not make what he asked. 
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock