McLottery
Failsafes are going to be things that will check to make sure that what is in the config file is supported. If not, the plugin wont run.
What this plugin does: It chooses a number 1-(Predetermined number). The players have the chance to guess (at the cost of a diamond) and the cost is added to a prize pool. If they get it wrong, they are told if their number was too low or too high. If they get it right, they win the Prize Pool and a new number is generated.
FUTURE UPDATES:
- Console Support
- Configuration
- IN GAME SET UP SUPPORT (will be added after config update)
- Support for more than just diamonds (In case the user wants to give Iron or Gold)
- Possible support for money rather than diamonds (iConomy)
- Other types of Lottery (?)
- Suggestions
This Plugin will create a game that is this dialogue but in plugin form. -"I'm thinking of a number 1-10,000" -"Is it 4035?" -"No, The number is higher"
If the player gets the guess wrong, a diamond will be taken from his inventory and added to a Prize Pool. When someone gets it right, they get the contents of the prize pool and the number will randomize once again.
This is basically the functionality of the code already made.
When the plugin is enabled, it will create a random integer between 1 and 10,000. Then, the message, "The McLottery number has been changed.".
The commands are as follows: /McLottery or /mcl is the "hub" command that will display basic information, including the size of the Prize Pool, the available numbers (1-10,000), the cost of guessing (1 diamond per guess), and how to play a game (command).
The next command is /McLGuess (number guess) or /McLG (Number guess). This is where the magic happens in the plugin. First, the plugin makes sure you formatted the command right by making sure they had 1 argument. Then, it will check if the person has a diamond in his/her inv to gamble. If they don't, a message will be sent to them. if they do, it will then check to make sure the number given is in the limit (1 - 10,000). If not, it will send a message. Then it will check to see if it is the correct number. If it is, then they win the prize pool and the number uses a random number function to restart. If they didn't, it will say that they lost and whether the number given was larger or smaller than the winning number.
Finally, the last command is only available to Ops. /McLGetNumber will return the winning number.
I intend for this plugin to add a fun way to use logic, collaborate with friends, and a lucky chance to get rich on a server. Also, I intend for this plugin to have a very easy installation process so many people can use it.
I hope this was enough, thank you for reading :).
Any update coming?
Can you make it broadcast while it broadcasts the max number, also the command how to guess? It would help alot and would not require lots more lines. Or maybe make it configurable to show howto in config.
Thank you!
What psirusa said. :)
pretty awesome, and simple plugin. Perfect for those of us who like "set and forget" server mods.
There is one feature which would make this plugin even more awesome... a default pot setting in the config file. i.e. the pot always starts at X of the given material type.
@Havefunpeeps
Pure awsomeness :)!
I was also thinking about that setpot thingy.. :) people wont play if nothing is in the pot.. so kinda an evil circle.. xD
@Unpluggeddk
I can't really "Fix" it because reload essentially restarts the entirety of the script, getting rid of the memory storage in the variable. I can, however, add a command /mclsetpot that will add the specified number of items to the pot automatically. Also, onDisable() will now have a message that says, "The pot before shutdown was _ items". I'll work on this update tonight.
@Unpluggeddk
Well , Using /reload is never a good thing. It causes errors with many plugins. Im not really sure if that is possible to "fix".
if server reloads the pot goes back to zero.. plzz fix
Hook the plugin into vault please for currency support! I will defiantly use this once it supports economy plugins like iConomy.
That might be a future update.
Great plugin! Can I make it so it costs the users a certain amount of currency instead of an item?
@Havefunpeeps
Darn it. as monster eggs are my valuta.. xD..
Thank u anyway, cant wait for the update<sub> :D</sub>
@Unpluggeddk
No, the plugin relies on Material Names. That might work for a future update. You need to use IRON_INGOT, GOLD_INGOT, or DIAMOND in the config file. Sorry.
Nice plugin
This is my error.
my betting item is: 383 = Monsteregg arent u allowed to use id numbers?
Updated to 1.1!
@simplimazing
Ill add that in the configuration update. It should happen today/tomorrow.
Also, the first configuration update will only include this and other materials (iron, gold, other items). I'm still learning how to configure chat colors and add iConomy support to the plugin.
Will we be able to change the available numbers. The gap is so huge. Would like the players to have a better chance at winning.
@ToXcWaStEBoY1
Im planning on releasing that on a later date. This was my first plugin, so adding that seems like a tough feat for me at the moment. I have an idea on how to do this though, it wouldn't be that hard. Now, would you rather have them configurable in the config file (One material?), or have all of them in the lottery? Then I'd have to do something like, 1 diamond gives 5 guesses, iron gives 1, gold gives 2, 10$ gives 1, etc.
is there any way that you can put in money as well as diamond, iron and gold? so players win money, like a REAL lottery
Yeah. Cool idea ;)