Able to open backpack during Arena event via GUI buttonSolved

i can use the backpack inside of events.. the command is blocked  but the GUI Button bypass the command blocks can u fix this please ?

Which plugin/version are you using to run events?

Which exact message do you see when the command is blocked via chat?

The recommended way to block backpacks opening during events is to allow Backpacks to do it by detecting the event, not by using another plugin to block the command. Backpacks does this automatically for multiple plugins such as Event Manager 3.x, 4.x, Arena, and others that use the same API method name. This is not something you can turn on or off.

Based on the Backpacks plugin code, there should be no difference between opening via the GUI button and opening via chat, for the purposes of checking if the player is in an event. So, I suspect you are experiencing this issue because you are using an unsupported event plugin/version that Backpacks does not support, such as the Event Manager 4.x beta (the released version of 4.x is compatible). The reason that the chat message is blocked is likely due to you having configured another plugin to block specifically the chat message.

If you are still running a forked version of Event Manager, I suggest you stop doing so since k1llyou has updated the plugin, and because maintaining a fork creates more work for people who could otherwise being doing something more impactful with their time.

iam using the paid version of event manager -> arena 

You can not run that command whilst playing in an event when i try /backpack 
by clicking on the UI it still opens the backpack

Someone reported this issue for Arena plugin previously.
https://umod.org/community/backpacks/32199-players-can-open-backpack-while-in-an-arena-event

I did not have the plugin source, so I relied on k1llyou telling me which API method name to use. I provided a beta version of Backpacks that should block it, but the requester never followed up to test so I released it anyway, but I was never able to verify that the patch worked.

Herb

You can not run that command whilst playing in an event when i try /backpack 
by clicking on the UI it still opens the backpack

I already understood this from your original post, and I addressed this in my previous response. The chat command and console command (which is used for the GUI button) are different. While it might be possible to block the console command the same way you are blocking the chat command, I would prefer instead that we resolve the issue where Backpacks is not automatically blocking it.

Can you please answer my original question, asking which version of Arena you are using?

Can you also look through the code of the Arena plugin to see if there is a method called IsEventPlayer? This is what Backpacks is checking for.

Arena 0.1.148

public object IsEventPlayer(BasePlayer player) => ToEventPlayer(player) != null ? (object)true : null;
the only thing i saw with isEventPlayer

Thanks for providing the snippet. That is what I was looking for.

Is the Arena plugin file called Arena.cs? If not, then Backpacks may be calling the wrong plugin.

Are you also using the latest version of Backpacks?

look on discord i think we can work faster then

Merged post

if anyone else has a issue with the arena plugin and the backpack plugin here is a fix !

 

the fix is as such, in Arena: change ToEventPlayer to:
public static EventPlayer ToEventPlayer(BasePlayer player) => player?.GetComponent<EventPlayer>();
and change IsEventPlayer to:
[HookMethod("IsEventPlayer")]
public bool IsEventPlayer(BasePlayer player) => ToEventPlayer(player) != null;

the problem was that IsEventPlayer was never actually called with the original method signature

Locked automatically