Lottery Command

Lottery Command

Postby Conor » 20 Feb 2013, 19:36

Hey.

SS_Legend requested me to make a lottery command for him so I thought I'd share it with everyone also, in case anybody else may like the idea of it.

I made it so that players can join the lottery at a ticket price, and then a portion of this price (e.g. 60%) is added to the lottery jackpot. At the end of the round a random play who bought a ticket wins the whole prize and everything is reset for the next round. You can decide on the price and the rate at which the prize pool increases.

This is pretty basic right now so if anybody else wants to suggest things to make it better that would be cool. Hopefully it works well also, I tested it once and it was okay, if anything weird happens then let me know o.O

You can see the code here:

http://pastie.org/private/s9qoca3xykptgqllh6w1w#11

Clearer:

http://pastie.org/pastes/6251268/text?k ... tgqllh6w1w

Forum Text:

Spoiler:


Oh, and I didn't want to fiddle with mySQL as I'm an amateur with it, and I don't want to mess anything up so for now offline players who win the prize aren't rewarded. But hey, its their fault for leaving!
Thanks.
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: Lottery Command

Postby ismellike » 20 Feb 2013, 23:31

Thanks, now I have an example for events, other than chat filter.
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: Lottery Command

Postby SS_Legend » 20 Feb 2013, 23:36

Thanks once again Conor for creating this for me! :)
Owner of [LS] Servers

Lava Survival: Image
Zombie Survival: Image
Website: http://legendservers.enjin.com/
SS_Legend
 
Posts: 116
Joined: 24 Feb 2012, 00:54

Re: Lottery Command

Postby Conor » 21 Feb 2013, 08:47

You're very much welcome. Sorry for the long wait ^^
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: Lottery Command

Postby dzienny » 23 Feb 2013, 00:51

That's one advanced plugin! The code is easy to follow and seems to be robust. I wonder how it works with many players on.
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27

Re: Lottery Command

Postby Leeizazombie » 17 Apr 2014, 18:19

dzienny wrote:That's one advanced plugin! The code is easy to follow and seems to be robust. I wonder how it works with many players on.

Added it to my server, so we'll see ;)

Also Conor, this is a very remarkable command! The zombie event you used will surely help me with future commands!
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.


Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 4 guests

cron