GuessTheNumber
If anyone would like to continue this simple project before I delete it, will gain full ownership/management of the project. Please pm regarding this matter.
Thanks.
Features
This plugin aims to provide users with something a little fun, just to bypass sometime or earn a reward. This plugin schedules a broadcast announcing to users to guess a value between x - x (where x is configurable). Once the user has submitted their answer, it will compare their answers with the random number, and if it's correct they will automatically receive an item which also can be configured in the config file.
Installation
Just drag and drop into your servers '\plugin' directory.
Permissions
Permission | Function |
---|---|
guess.use | Gives access to /guess <value> or /g <value> |
guess.admin | Gives access to /gtn start |
guess.admin | Gives access to /gtn info - (Default users have no need to access this) |
Commands
Command | Function | Alias |
---|---|---|
/gtn info | Lists commands | N/A |
/guess <value> | Submits your answer against random value | /g <value> |
/gtn start | Starts/Restarts scheduled broadcast | N/A |
Config
values: min: 1 max: 5 item-prize: 57 # Your message if the value is incorrect wrong-value-message: '&cWrong number, try again!' broadcaster: enable: true # Values below are set in seconds. # When you want it to start after the correct answer. start-delay: 60 # How often you want the message announced (in seconds). interval: 120 # Your broadcast message # Do NOT delete the min and max variables broadcast-message: '&2Guess a number between %min% - %max%' # Your broadcast message for the winner # Do NOT delete the player variable broadcast-winning-message: '&9%player% &2has won the prize!'
Source
- Source
To-Do
- Add a cooldown before enabling the scheduled broadcast
- Commands to edit the config file in game
- Add reload command
- Add stop command
Uh... there seems to be a huge bug - when a player enters a right number, the message says that someone else got the right number. It still gives prize to the player who entered the number, though.
I got an idea - make each /guess command cost some money - a hook to Vault would be enough. You could also add statistics of who is the greatest guesser on server - > command like /guesstop
@brian163b
No problem, I still have your suggestions in mind.
@JaackMC
Yes, I will add that as well
@Paramorefan1994
@ke4zzy
Download v2.0 once it has been approved, don't worry it won't show the correct answer.
Well shit... I thought I removed that, that was only added to test if random numbers were being generated each time -.-. Sorry about that, I release an update for it tomorrow, need to sleep.
Edit: Scratch that, read above post.
@Paramorefan1994
Yes I see the same thing. Users are easily winning. Just type wrong answer and it gives them the correct one.
Hi, I installed your plugin this morning, I deop myself and move to builder, to test that it works. I works great, but when you get the answer wrong it says "Wrong number, please try again: <the correct answer>" and you can just type that answer in and get the reward... how do I turn "The correct answer" off? Thanks.
@HenzQ
Awesome, I'll give a try. Thank again for your effort!
Maybe hook it into Vault so users pay in-game money per guess? otherwise they could just spam /g with loads of numbers.
@brian163b
Sorry I haven't been working on this lately, but I've gone ahead and thrown in #2 and #3 of your suggestions from your list, so feel free to download the new version.
Thanks!
(If it hasn't been uploaded, you'll most likely have to wait until BukkitDev Staff approve of it)
I have a couple of suggestions.
1. Have a "/gtn reload" command to reload it in game. That would allow us to change the prizes as we want. 2. Can you add a limit to the number of guesses? 3. Can we just stop the plugin, so its not always running? I tried putting -1 in and I think it still runs. I want it to only run when I type /gtn start and stop when you type /gtn stop.
This is a great start and I like the idea of a guessing game like this. I'm trying to find something to tie into a redstone invention I made and this could be a good method for players to trigger what I'm looking for.
@HenzQ
Thanks, I appreciate you considering them, your time, and your sharing your plug-in!
@brian163b
I will take all of your ideas into consideration, it'll be quite sometime as I have other projects being worked on.
Thanks for your suggestions. :)
Edit: The 'bug' you stated was intentional, the /g or /guess commands will be temporarily locked and can only be enabled by using /gtn start for now. This was just done to prevent users from winning more items even when there was no announcements. But I should have this fixed shortly.
@FrostbiteNZ
It wasn't just me, it was Henz too. :)
I run a private family friendly server and this very idea came to mind to give out random prizes. And then I found your plugin! Nice! ;-)
First, a question (bug?) After winning a prize and another "round" (broadcast) is started, I repeatedly get the message "this command is temporarily disabled" when guessing again. I thought maybe this was a "you can only win once per X minutes" restriction but I see no parameter for it. Only doing an /rtn start seems to clear this although I didn't wait more than a few minutes to see how long the temp lock might last.
I would like to suggest a few ideas:
1) Would it be possible to have item-prize a multi-valued (comma-delimited?) field and each time the plugin starts a new round (broadcast) it choses one of the prizes from the list? That would add a bit more fun and encourage people to participate more.
2) Could a third "wait" interval be added for a delay between broadcast intervals? So the server waits 60 seconds (start delay), broadcasts a game, then waits X before broadcasting another round.
3) Allow the broadcast, "win", "guess again" responses to be customized. (For example, I'd prefer the broadcast say "New round! Guess a number between x-y.")
4) Option to allow each player to guess X times per round. (Then a customizable "loss" message would display like "sorry, your 3 chances are up. Try again next round.")
5) Add /gtn stop command so Ops can pause the game until it is either restarted or server is reloaded.
6) Allow users a command to opt in/out of the broadcasts.
@BDKing00 Glad you made it :P
@FrostbiteNZ
Glad you like it! :)
This Is A Great Simple Plugin I Will Be Using It On My Server Keeps People From Getting Bored.