Jump to content
MakeWebGames

[mccode v2] Lottery


Akash

Recommended Posts

  • Replies 89
  • Created
  • Last Reply

Top Posters In This Topic

Re: [Free V2] Lottery

I think it should be pointed out that while you can call anything a lotto, when you give out a weekly, monthly, daily price its a raffle, not a lotto. People know theres going to be a winner at a set time peroid. I'm not taking away from the code or idea behind it but its not a lotto.

I have coded a few lotto's and I think the key point that makes a lotto a lotto is the ability for a "pot" to keeep collecting in size. Like I said I'm not getting down here, this was posted free and props for that, I'm just saying maybe call it a monetary raffle?

Of course of the user did state "a weekly cron chooses a random winner and credits them with the jackpot".

And as a final note. Do you know why you would sprintf something?

Link to comment
Share on other sites

Re: [Free V2] Lottery

Hey i change $tick = 1; so people can only buy one ticket but they can still buy like loads.

I need to only allow them to buy one. plus the cron can you please explain more about the cron.

plus unsure wht

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; means

Thanks

Link to comment
Share on other sites

  • 3 weeks later...

Re: [Free V2] Lottery

For some odd reason, the winner of the lottery wasn't credited the jackpot. It is in the cron_weekly, and I have an new_announcement query after the crediting query, and that worked. So, I know there is nothing wrong with the crediting query. :(

Link to comment
Share on other sites

  • 4 weeks later...

Re: [Free V2] Lottery

I thought I'd edit this a little bit to allow the user to enter the amount of tickets they'd like to buy. :) Hope you don't mind Akash. ;) :-P

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Make sure to have run the SQLs and crons posted in the first post by Akash. :)

 

I'm still a newbie, so this probably could have been done a lot easier. :-P Hope you all enjoy. :)

 

EDIT: Removed include "travellingglobals.php"; from code. It should work now. :)

Link to comment
Share on other sites

Re: [Free V2] Lottery

You get the error message below, so all you need to do is remove this line: include "travellingglobals.php";

Warning: include(travellingglobals.php) [function.include]: failed to open stream: No such file or directory in /home/ml/public_html/lottery.php on line 4

Warning: include() [function.include]: Failed opening 'travellingglobals.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/ml/public_html/lottery.php on line 4

Link to comment
Share on other sites

Re: [Free V2] Lottery

 

You get the error message below, so all you need to do is remove this line: include "travellingglobals.php";

Warning: include(travellingglobals.php) [function.include]: failed to open stream: No such file or directory in /home/ml/public_html/lottery.php on line 4

Warning: include() [function.include]: Failed opening 'travellingglobals.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/ml/public_html/lottery.php on line 4

 

Just remove this.....

include "travellingglobals.php";

Link to comment
Share on other sites

Re: [Free V2] Lottery

sorry about the slow reply yes i got it setup in my cron and i keep going over it and it just doesnt credit lol but hey heres the code lol from what i can see it should work or am i wrong it doesnt even add the event lol

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Re: [Free V2] Lottery

 

You could try this:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

This code also adds an announcement saying who won the lottery. :)

looks like it should work i see a few mistakes i made now thanks war_hero :evil: still not working i ahve checked the codes and the sql it works fine but the cron still doesnt work

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...