NonStopCoding Posted June 5, 2015 Posted June 5, 2015 (edited) This module is not completed yet but its nearly there so ill post up the code Module Info Module Name: Lottery System Module Version: v1.00 Module Creator: NonStopCoding This module will allow users to be able to buy a lottery ticket or tickets depending on what you the game owner set max tickets to be for the demo purposes i only used 10. The more tickets you buy the better of a chance (kinda its still pretty much random) you have at winning Staff members with user level of 2 can update the ticket price and set max tickets user can buy Secured the code the best i can (please do post if you find a weak point) SQL You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. open up your globals.php goto the very last line and add this code You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. save and close globals.php lottery.php - (Please Remember to remove ,$allowed from line 21) http://pastebin.com/0BRjW8an lotto_cron.php This file here i used mccodes v2.05b if you use lower version of mccodes this might not work for you if so remove this snippet of code and add your's from your cron file You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Some Screenshots [ATTACH=CONFIG]2087[/ATTACH][ATTACH=CONFIG]2088[/ATTACH][ATTACH=CONFIG]2089[/ATTACH] Edited June 6, 2015 by NonStopCoding Quote
NonStopCoding Posted June 6, 2015 Author Posted June 6, 2015 Thanks jc iv updated op and lowered the int just noticed it was at 30 no need for that high lol Quote
-BRAIDZ- Posted June 6, 2015 Posted June 6, 2015 This module is not completed yet but its nearly there so ill post up the code Module Info Module Name: Lottery System Module Version: v1.00 Module Creator: NonStopCoding This module will allow users to be able to buy a lottery ticket or tickets depending on what you the game owner set max tickets to be for the demo purposes i only used 10. The more tickets you buy the better of a chance (kinda its still pretty much random) you have at winning Staff members with user level of 2 can update the ticket price and set max tickets user can buy Secured the code the best i can (please do post if you find a weak point) SQL You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. open up your globals.php goto the very last line and add this code You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. save and close globals.php lottery.php - (Please Remember to remove ,$allowed from line 21) http://pastebin.com/0BRjW8an lotto_cron.php This file here i used mccodes v2.05b if you use lower version of mccodes this might not work for you if so remove this snippet of code and add your's from your cron file You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Some Screenshots [ATTACH=CONFIG]2087[/ATTACH][ATTACH=CONFIG]2088[/ATTACH][ATTACH=CONFIG]2089[/ATTACH] Thanks mate, works well. Can't seem to get the cron working though.. Any suggestions? Quote
-BRAIDZ- Posted June 6, 2015 Posted June 6, 2015 (edited) Did you edit the cron? Yes, I removed the first 9 lines as mentioned.. Now I have added from one of my crons.. But still nothing You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Edited June 6, 2015 by -BRAIDZ- Quote
-BRAIDZ- Posted June 6, 2015 Posted June 6, 2015 Made a few adjustments, what do you think? [ATTACH=CONFIG]2090[/ATTACH] Quote
KyleMassacre Posted June 6, 2015 Posted June 6, 2015 When you type in your crons url in your address bar what does it say? Quote
-BRAIDZ- Posted June 6, 2015 Posted June 6, 2015 When you type in your crons url in your address bar what does it say? Returns a blank screen. Yes I know crons are meant to do this. But it doesn't truncate the tables or credit a winner or anything like that Quote
KyleMassacre Posted June 6, 2015 Posted June 6, 2015 Then you have no visible errors and everything is running like a dream as far as i can tell. At the end of all your queries before the semi colon put in You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Similar to this: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
-BRAIDZ- Posted June 6, 2015 Posted June 6, 2015 Then you have no visible errors and everything is running like a dream as far as i can tell. At the end of all your queries before the semi colon put in You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Similar to this: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Okay, will try that soon Quote
AdamHull Posted June 6, 2015 Posted June 6, 2015 I really do think you Gould scrap Ravans, every mod you have had problems with Quote
-BRAIDZ- Posted June 6, 2015 Posted June 6, 2015 I really do think you Gould scrap Ravans, every mod you have had problems with Yeah I know Quote
NonStopCoding Posted June 6, 2015 Author Posted June 6, 2015 (edited) edit - - - Updated - - - Yeah I know Only thing i can think of that would throw the code off is if you dont have the event_add function check the include "config.php"; make sure that it has the global_funcs.php file included in it if not i guess this could be your problem if so heres your fixe choices 1. Add this code into your config file some place You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 2. copy the code below into your cron file You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. There is slim chance that this event_add function might be dfiffrent from yours but if so open up your global funcs file and find the function and copy it into the module 3. try add this to your cron You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Edit: Also without the money_formatter() function the code will fail Edited June 6, 2015 by NonStopCoding Quote
-BRAIDZ- Posted June 6, 2015 Posted June 6, 2015 edit - - - Updated - - - Only thing i can think of that would throw the code off is if you dont have the event_add function check the include "config.php"; make sure that it has the global_funcs.php file included in it if not i guess this could be your problem if so heres your fixe choices 1. Add this code into your config file some place You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 2. copy the code below into your cron file You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. There is slim chance that this event_add function might be dfiffrent from yours but if so open up your global funcs file and find the function and copy it into the module 3. try add this to your cron You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Edit: Also without the money_formatter() function the code will fail Still nothing You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
NonStopCoding Posted June 6, 2015 Author Posted June 6, 2015 Still nothing You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. meh i dunno then stupid ravens Quote
KyleMassacre Posted June 6, 2015 Posted June 6, 2015 What editor do you use? You keep getting asterisks in your code. Whatever it is uninstal it and get something better like sublime text, PHPStorm, NetBeans, or hell even NotePad++. I would prefer you get PHPStorm if you have the money or get NetBeans, that way you get some IDE functionality like code completion and better error handling inside the text editor. Also, look into logging errors or create your own error handler, you only say you get a blank screen but we can't help you unless you tell us your error Quote
Coly010 Posted June 6, 2015 Posted June 6, 2015 Also, if you use an editor, save the file, then upload the file, overwriting the existing one. Don't copy and paste it into the online code editor. To me it seems you may have an encoding format problem. Quote
-BRAIDZ- Posted June 7, 2015 Posted June 7, 2015 Also, if you use an editor, save the file, then upload the file, overwriting the existing one. Don't copy and paste it into the online code editor. To me it seems you may have an encoding format problem. Okay thanks, I will look for one, at the moment I am using my phone, so I will look for a php editor for mobile Quote
NonStopCoding Posted June 7, 2015 Author Posted June 7, 2015 Okay thanks, I will look for one, at the moment I am using my phone, so I will look for a php editor for mobile I mix my editors up but there for windows your sony runs off android i have same phone accept a lower version mine is the Sony Xperia L the apps for php editors are pretty crap for android i must admit Aptana Studio 3 The world’s most powerful open-source web development IDE just got better. Rebuilt from the ground-up. It's now much faster, customizable and includes new features to help you be more productive. Learn more. download http://www.aptana.com/products/studio3/download.html I also use notepad ++ (i only use this for mysql coding as aptana don't handle it but if you have both installed and create a file with the db extention it opens notepad++ for you ) Quote
KyleMassacre Posted June 7, 2015 Posted June 7, 2015 I mix my editors up but there for windows your sony runs off android i have same phone accept a lower version mine is the Sony Xperia L the apps for php editors are pretty crap for android i must admit Aptana Studio 3 The world’s most powerful open-source web development IDE just got better. Rebuilt from the ground-up. It's now much faster, customizable and includes new features to help you be more productive. Learn more. download http://www.aptana.com/products/studio3/download.html I also use notepad ++ (i only use this for mysql coding as aptana don't handle it but if you have both installed and create a file with the db extention it opens notepad++ for you ) That right there is false advertisement and grounds for why anyone shouldnt use it. Quote
NonStopCoding Posted June 7, 2015 Author Posted June 7, 2015 That right there is false advertisement and grounds for why anyone shouldnt use it. iv used it for ages and never had any issues at all Quote
-BRAIDZ- Posted June 11, 2015 Posted June 11, 2015 Still no luck with the cron... Looks like I may have to just scrap the lottery on my game if I can't get the cron working Quote
sniko Posted June 11, 2015 Posted June 11, 2015 Still no luck with the cron... Looks like I may have to just scrap the lottery on my game if I can't get the cron working What error/issue are you encountering with the cron? Cron doesn't run at all Cron doesn't run at the correct time Query failsWhat fails about it? Have you debugged it?How did you debug it? Quote
-BRAIDZ- Posted June 11, 2015 Posted June 11, 2015 What error/issue are you encountering with the cron? Cron doesn't run at all Cron doesn't run at the correct time Query failsWhat fails about it? Have you debugged it?How did you debug it? Not running at all. This is what I have You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
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.