Akash Posted June 3, 2008 Share Posted June 3, 2008 This mod basically allows you to purchase upto 100 lottery tickets, which can be easily changed. Each ticket is x amount, $100 in my case, and everytime a user buys a ticket, $x is added to the jackpot. Then a weekly cron chooses a random winner and credits them with the jackpot. Please note I did create this myself :). Hope you all enjoy. Screenshots are unnecessary. I have posted for V1+V2 but not 100% if V1 is fully working. I'm testing it now. For V2 ONLY! 1. Create a file called lottery.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 2. Then add the following sql: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 3. Finally create a weekly cron file (cron_weekly.php) and add the following: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. ENJOY :wink: Sorry if something similar has been made before, but I assure you the code style is different. Please report any bugs :). Quote Link to comment Share on other sites More sharing options...
-Matt- Posted June 3, 2008 Share Posted June 3, 2008 Re: [Free V2] Lottery Very Nice. Quote Link to comment Share on other sites More sharing options...
iR00T Posted June 3, 2008 Share Posted June 3, 2008 Re: [Free V2] Lottery i no i already told u but i want everyone to no this mod is great lol well i might adjust it a lil to my needs but other than that i had no prob with it no errors nothing ;) Quote Link to comment Share on other sites More sharing options...
Akash Posted June 3, 2008 Author Share Posted June 3, 2008 Re: [Free V2] Lottery Thanks guys :) If anyone out there is willing, please convert to V1 correctly, I've never used V1 so have no idea...as far as I know my conversion doesn't work. Thanks :) Quote Link to comment Share on other sites More sharing options...
iR00T Posted June 3, 2008 Share Posted June 3, 2008 Re: [Free V2] Lottery i have found a error Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/chrisell/public_html/lottery.php:2) in /home/chrisell/public_html/globals.php on line 6 Quote Link to comment Share on other sites More sharing options...
The Ace Posted June 3, 2008 Share Posted June 3, 2008 Re: [Free V2] Lottery Joker....are you using V1? Coz, as it says, it's not tested properly yet and doesn't work.... Akash, this is a great mod! When does the jackpot go out...? On which day? :-P Quote Link to comment Share on other sites More sharing options...
iR00T Posted June 4, 2008 Share Posted June 4, 2008 Re: [Free V2] Lottery yea v2 of my game engine its not mccdodes i jsut mccode tables that is itlol Quote Link to comment Share on other sites More sharing options...
Akash Posted June 4, 2008 Author Share Posted June 4, 2008 Re: [Free V2] Lottery It's not MCCodes? Well obviously it's not going to work then :|. Joker, I already told you on MSN that it works fine on V2 must be something you've edited elsewhere. The Jackpot goes out whenever you set it. I run that cron_weekly.php every week so the jackpot goes out weekly but you can do it daily or every few days. Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted June 4, 2008 Share Posted June 4, 2008 Re: [Free V2] Lottery lol i heard jokers using his knowledge of injections to hack games... bad idea mate i'd stop since you did it to the wrong site and their after your balls on a silver platter :-D they even asked me to help them but i don't get involved in crimes... have fun also nice mod Akash, Joker is a little dumb so give him time to understand why it doesn't work mate... he's slow... Quote Link to comment Share on other sites More sharing options...
The Ace Posted June 4, 2008 Share Posted June 4, 2008 Re: [Free V2] Lottery Whereabouts do I change it so the lottery goes out on Fridays? Quote Link to comment Share on other sites More sharing options...
Tonka Posted June 4, 2008 Share Posted June 4, 2008 Re: [Free V2] Lottery set the cron to run at 0 24 * * 6, this will make it run at the new day every friday Quote Link to comment Share on other sites More sharing options...
The Ace Posted June 4, 2008 Share Posted June 4, 2008 Re: [Free V2] Lottery Thanks Tonka! I had to change the 24 to a 0, because it goes from 0-23....lol. But I kept the 6 at 6...so does it still mean it goes out every Friday at 00:00 or Saturday......or Sunday....? :-P lol Quote Link to comment Share on other sites More sharing options...
Lithium Posted June 4, 2008 Share Posted June 4, 2008 Re: [Free V2] Lottery lol that goes at 24:00 saturday or... 00:00 sunday ;) Quote Link to comment Share on other sites More sharing options...
Tonka Posted June 4, 2008 Share Posted June 4, 2008 Re: [Free V2] Lottery ok, i made a mistake with what i gave it should be 0 0 * * 5 0-Sunday 1-Monday 2-Tuesday 3-Wednesday 4-Thursday 5-Friday 6-Saturday Quote Link to comment Share on other sites More sharing options...
Akash Posted June 4, 2008 Author Share Posted June 4, 2008 Re: [Free V2] Lottery lol i heard jokers using his knowledge of injections to hack games... bad idea mate i'd stop since you did it to the wrong site and their after your balls on a silver platter :-D they even asked me to help them but i don't get involved in crimes... have fun also nice mod Akash, Joker is a little dumb so give him time to understand why it doesn't work mate... he's slow... hmm yeah, I just happen to notice Joker is a bit stupid. Not only does he attempt to hack games but apparently he hacked some guys email/msn... :-P (Course he did :wink:). I get MSN messages from him saying "try n hack my game". And he thinks it's impossible...well he's wrong. LOL Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted June 4, 2008 Share Posted June 4, 2008 Re: [Free V2] Lottery i was on a game earlier he threated to hack everyone i showed him my ip turned off my firewall n av's and give him the telnet command he still couldn't do it... now that shows how much of a noob he is. i personally hate posting stuff on ce cause of him being here i wont be posting free mods anymore anyways not for him to use, he actually got his msn accounts owned lol all 4 of them the other week. Karma sucks doesn't it ellis :wink: lmfao Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted June 4, 2008 Share Posted June 4, 2008 Re: [Free V2] Lottery hmm yeah, I just happen to notice Joker is a bit stupid. Not only does he attempt to hack games but apparently he hacked some guys email/msn... :-P (Course he did :wink:). I get MSN messages from him saying "try n hack my game". And he thinks it's impossible...well he's wrong. LOL Thats very true i have people mailing me on msn saying he hacked their games using sql injections i wonder were he was taught them... lmao he actually threatened to kill someone when he comes to england with his gun...<~he doesn't know england then huh we should tell him to goto Nottingham or Manchester maybe Liverpool that would be hilarious. Quote Link to comment Share on other sites More sharing options...
endo Posted June 10, 2008 Share Posted June 10, 2008 Re: [Free V2] Lottery lol tell joker to come to london he will be at the bottom of the thames with concrete shoes before he know it lol Quote Link to comment Share on other sites More sharing options...
The Ace Posted June 11, 2008 Share Posted June 11, 2008 Re: [Free V2] Lottery Ummm....I think I have found a slight problem: (this is from my DB) Full Texts id userid amount jackpot Edit Delete 1 1 100 1800 Edit Delete 2 1 100 1700 Edit Delete 3 1 100 1600 Edit Delete 4 1 100 1500 Edit Delete 5 1 100 1400 Edit Delete 6 1 100 1300 Edit Delete 7 1 100 1200 Edit Delete 8 1 100 1100 Edit Delete 9 1 100 1000 Edit Delete 10 1 100 900 Edit Delete 11 1 100 800 Edit Delete 12 1 100 700 Edit Delete 13 1 100 600 Edit Delete 14 1 100 500 Edit Delete 15 1 100 400 Edit Delete 16 1 100 300 Edit Delete 17 1 100 200 Edit Delete 18 2 100 1600 Edit Delete 19 2 100 1500 Edit Delete 20 2 100 1400 Edit Delete 21 2 100 1300 Edit Delete 22 2 100 1200 Edit Delete 23 2 100 1100 Edit Delete 24 2 100 1000 Edit Delete 25 2 100 900 Edit Delete 26 2 100 800 Edit Delete 27 2 100 700 Edit Delete 28 2 100 600 Edit Delete 29 2 100 500 Edit Delete 30 2 100 400 I have highlighted the problem in RED I am ID 1, and I bought 15 tickets, so the jackpot read £1500. Then when ID 2 bought a few tickets, it didn't change in the actual game. It seems that each user has their own jackpot....anyone know how to fix this...? :-P The ID for the ticket bought, I think is wrong.... ID 1 should have a jackpot of £100...therefore ID 18 should have a jackpot of £1,800.... :) Quote Link to comment Share on other sites More sharing options...
iR00T Posted June 12, 2008 Share Posted June 12, 2008 Re: [Free V2] Lottery i was on a game earlier he threated to hack everyone i showed him my ip turned off my firewall n av's and give him the telnet command he still couldn't do it... now that shows how much of a noob he is. i personally hate posting stuff on ce cause of him being here i wont be posting free mods anymore anyways not for him to use, he actually got his msn accounts owned lol all 4 of them the other week. Karma sucks doesn't it ellis :wink: lmfao ha zero yes i new it was u and ps where u scared to show ur name..?... Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted June 12, 2008 Share Posted June 12, 2008 Re: [Free V2] Lottery ha zero yes i new it was u and ps where u scared to show ur name..?... Well its Knew* not new.. and if you have evidence then phone the police if not then piss off, btw it wasn't actually me lol Quote Link to comment Share on other sites More sharing options...
The Ace Posted June 14, 2008 Share Posted June 14, 2008 Re: [Free V2] Lottery This problem is linked to the first: When the lottery goes out when there is more than one person in it, the winner only got £1,800, and not £3,400. ID 2 won, but he didn't get the £1,800! Grr! :x Quote Link to comment Share on other sites More sharing options...
nypthamine Posted June 16, 2008 Share Posted June 16, 2008 Re: [Free V2] Lottery You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNIX_TIMESTAMP(),0,'You won the weekly lottery and were credited $')' at line 1 INSERT INTO events VALUES('',,UNIX_TIMESTAMP(),0,'You won the weekly lottery and were credited $') Quote Link to comment Share on other sites More sharing options...
criminalcombatrpg Posted June 29, 2008 Share Posted June 29, 2008 Re: [Free V2] Lottery Appears there is actually an issue. The issue is that the event is sent when the cron is ran but the money is NOT credited. :? May I also suggest that you simply change money to crystals and make this into a crystals lottery aswell? Quote Link to comment Share on other sites More sharing options...
Akash Posted July 1, 2008 Author Share Posted July 1, 2008 Re: [Free V2] Lottery Guys...I spologise for the error. However, there is only two main errors, 1. Money is not being credited 2. A new jackpot starts for every person. I'm editing and fixing them...give me a bit. Thanks and enjoy the completed mod soon. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.