Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disallow sign use / purchase if inventory is full. #23

Open
mibby opened this issue May 8, 2020 · 10 comments
Open

Option to disallow sign use / purchase if inventory is full. #23

mibby opened this issue May 8, 2020 · 10 comments
Labels
💡 Suggestion Suggestion to evolve the plugin

Comments

@mibby
Copy link

mibby commented May 8, 2020

No description provided.

@EpiCanard
Copy link
Collaborator

EpiCanard commented May 9, 2020

Hello :)

Maybe a little more information will be helpful.

What is your goal ?
Why do you want this feature ? Because a sign will add an item to the player inventory ?
Should the hand be empty or can it be at least one empty space anywhere in the inventory ?

Thanks for your suggestion
EpiCanard

@mibby
Copy link
Author

mibby commented May 9, 2020

I use ServerSigns in a couple of places that have a cost to them. Upon interacting with them, it runs commands that spawn in items to give players rewards. If a player has a full inventory, they are still charged for the sign interaction and the command still runs despite not being able to be given the item.

To combat this, I would like an option to deny sign interaction if their inventory is completely full.

@EpiCanard EpiCanard added the 💡 Suggestion Suggestion to evolve the plugin label May 9, 2020
@EpiCanard
Copy link
Collaborator

EpiCanard commented May 11, 2020

Ok, I see two ways to do it :

  • add a custom config to the sign
  • or add an operator isInventoryFull

The operator may be the best solution if you want to do action before or after this inventory check

@leasoncre
Copy link

PAPI?: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders#player
%player_has_empty_slot%
%player_empty_slots%

@EpiCanard
Copy link
Collaborator

@leasoncre You are right !
@mibby SVS supports PlaceholderAPI so you can use it with your sign :

/svs add <if> placeholder:%player_has_empty_slot%=true

@mibby
Copy link
Author

mibby commented May 20, 2020

@EpiCanard That would not prevent charging though. That is for adding a conditional check for commands to run. ServerSigns charges on interact before it runs the commands / conditional checks. I would like to be able to have a check that prevents interaction / charging if they don't have any room in their inventory.

@leasoncre
Copy link

run the eco take command, instead of using the svs cost

@mibby
Copy link
Author

mibby commented May 26, 2020

Then there is no deny message when players interact with the sign if they don't have enough money and the eco take command would allow them to go negative or 0 rather than requiring the full balance, unless there was another placeholder conditional check to only run if they have over that exact amount of money.

This becomes messy and more complex than just a simple sign config option check to deny interacting with signs if their inventory is full.

@EpiCanard
Copy link
Collaborator

I will see to add this feature inside sign flags

I don't have much free time, it can take time :)

@aparry91
Copy link

run the eco take command, instead of using the svs cost

not ideal but could you not then build out your own if statement for balance check aswell.. I think I did this prior to learning about serversigns integrated payment requirement. Maybe this is the exception for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Suggestion Suggestion to evolve the plugin
Projects
None yet
Development

No branches or pull requests

4 participants