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

    • https://forum.smart-guard.eu/login/ maybe try here idk
    • "If you’re not on the internet, you don’t exist." — Bill Gates And to be on the internet, you need to be visible. In 2025, SMM is not just advertising. It’s a systematic process that makes your brand noticeable, recognizable, and in demand. Every day, millions of posts are created across social media and content platforms. If you don’t claim your spot in this stream, your project will simply vanish in the noise. SMM means: ➡ Constant growth of followers, likes, and comments ➡ Increasing reach and engagement ➡ Presence on all key platforms ➡ Driving targeted traffic to your website or app ➡ Building brand image and audience trust Doing all this manually is time-consuming and expensive. That’s why we created the SocNet SMM Panel — a convenient, fast, and powerful tool that automates promotion across top platforms. Use our SMM Panel to boost and promote on Facebook, Instagram, Telegram, Spotify, Soundcloud, YouTube, Reddit, Threads, Kick, Discord, LinkedIn, Likee, VK, Twitch, Kwai, TikTok, Trust Pilot, Apple Music, Tripadvisor, Snapchat, and more. Followers, likes, views, reposts, listens, viewers, reactions, comments — all in one place, without complex setup or extra costs. Get $1 for your first trial launch: Simply create a ticket with the subject “Get Trial Bonus” on our website (Support) ➡ Go to SMM Panel (clickable) or via support in the bot How to order: ➡ SMM Panel: Click - promotion for your social media accounts. ➡ SMM Panel directly inside our Telegram bot: Click (Menu ➡ SMM Panel) Our digital goods store: ➡ Online Store: Click ➡ Telegram Bot: Click Regular customers get extra discounts and promo codes! Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n ➡ Discord: socnet_support ➡ Discord Server: https://discord.gg/y9AStFFsrh ➡ ✉ Email: solomonbog@socnet.store You can also use these contacts to: — Consult on wholesale purchases — Establish a partnership (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — store of digital goods and premium subscriptions
    • can you give me please on pm his telegram ?   
    • Hello, I need support i cannot pay for smart-guard.eu smartguard protection, there is no payment button, i tried to add a new product, or buy it as new even with new email, there is no payment button, i tried to reach riotta on skype or akumu but i have no contacts for akumu, please help.
  • 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