Jump to content
  • 0

Bot report button problem


Question

Posted

Hi guys i have one issue with my bot report button a player can spam it without get the message "You have already reported this player"

 

What i have done wrong?

 

L2PcInstance:

public boolean isBotReportedBy(L2PcInstance botReporter)

   {
        if (_botReportedBy.isEmpty())
            return false;
        for (L2PcInstance reporter : _botReportedBy)
        {
            if (reporter == null)
                continue;
            if (reporter == botReporter)
                return true;
        }
        return false;
    }

 

 

RequestActionUse:

case 65: // Bot Report Button
                if (target == null)
                    return;
                if (target == activeChar)
                    return;
                if (!(target instanceof L2PcInstance))
                    return;
                L2PcInstance targetPlayer = (L2PcInstance) target;
                if (activeChar.isInsideZone(ZONE_PEACE))
                {
                    activeChar.sendMessage("Cannot use this function in the peace zone.");
                    return;
                }
                if (targetPlayer.isInsideZone(ZONE_PEACE))
                {
                    activeChar.sendMessage("Cannot use this function if the target is in a peace zone.");
                    return;
                }
                if (((L2PcInstance) target).isBotReportedBy(activeChar))
                {
                    activeChar.sendMessage("You have already reported this player.");
                    return;
                }

 

Tnx guys.

7 answers to this question

Recommended Posts

  • 0
Posted

Maybe, it doesn't work because you don't add the reporter in the _botReportedBy.

  • 0
Posted

Maybe, it doesn't work because you don't add the reporter in the _botReportedBy.

How i can add this?

 

Also forgot to add this:

// List to contain players who have bot reported this L2PcInstance

private FastList<L2PcInstance> _botReportedBy = new FastList<L2PcInstance>();

 

I think that this should add reporter but it seems not work

 

  • 0
Posted

The only issue that i can find is that this code dont work :

// List to contain players who have bot reported this L2PcInstance
   private FastList<L2PcInstance> _botReportedBy = new FastList<L2PcInstance>();

 

In result not getting this message

 

                if (((L2PcInstance) target).isBotReportedBy(activeChar))
                {
                    activeChar.sendMessage("You have already reported this player.");
                    return;
                }

 

 

How can i fixed that?

  • 0
Posted

Needs COMPLETE bot report button... Must have something like

_botReportedBy.add(

and also once punished a 

_botReportedBy.clear();

 

Finally it's idiot to store such a list by player, a single Map on a manager is enough. It's not like you will have 10000 registrations anyway, but your 200-300 lists will be really created for nothing.

  • 0
Posted

Needs COMPLETE bot report button... Must have something like

_botReportedBy.add(

and also once punished a 

_botReportedBy.clear();

 

Finally it's idiot to store such a list by player, a single Map on a manager is enough. It's not like you will have 10000 registrations anyway, but your 200-300 lists will be really created for nothing.

But button work fine but the problem is that is spamable also is not connected with ban or not ,this will happen manual.

 

My problem is that this code dont work and players can spam report button.

  • 0
Posted

I appreciate you quoted me, but that would be better if you actually read the content of the quote.

 

isBotReportedBy( should be

 

{
if (list.contains(reporter)
return true;

return false;
}

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

    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Yes, just keep this post=)
  • 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