Paul Evans Posted March 11, 2011 Share Posted March 11, 2011 i wasn't actually referring to you mate, was referring my comments to HD as it seems he believes it's something different... It is a nice mod by the way :D Quote Link to comment Share on other sites More sharing options...
War_Hero Posted March 11, 2011 Author Share Posted March 11, 2011 i wasn't actually referring to you mate, was referring my comments to HD as it seems he believes it's something different... It is a nice mod by the way :D Sorry if my message seemed abrupt and harsh, I didn't mean it to. :) And thank you very much. :D I may have to alter it though. Although it is more realistic and what not, it is very, very, very, very unlikely the jackpot will be won due to the small amount of tickets that will actually be bought. I'll think of something. :) Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted March 11, 2011 Share Posted March 11, 2011 Well paul, the last time i have actualy used the mccode's v2.0 mysql library, was like uhm, 5 year's ago. I used it for like 1 month when it first came out and never used it since. Quote Link to comment Share on other sites More sharing options...
Paul Evans Posted March 11, 2011 Share Posted March 11, 2011 PM me HD i don't wanna spam this persons thread but im sure i can provide you with proof of you using it recently :) Quote Link to comment Share on other sites More sharing options...
JohnGato Posted March 15, 2011 Share Posted March 15, 2011 Great mod......... finally got it working :)......... is there away to see the tickets that are bought... Like maybe having the ticket numbers shown underneath the ticket board Quote Link to comment Share on other sites More sharing options...
jay-dogg2009 Posted November 21, 2011 Share Posted November 21, 2011 a revamp of the code i decided to add a few more featuers to the system Last 5 lottery results and as i use 25 titckets to be bought it will also show the last 25 tickets bought as well now here the code: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
Teh Sin Posted December 24, 2011 Share Posted December 24, 2011 (edited) Hello so I have added this mod into my website and when the weekly cron runs I get this output. Warning: Missing argument 3 for event_add(), called in /home/ab1074/public_html/crons/are/not/4u/1_week_cron.php on line 94 and defined in /home/ab1074/public_html/6.php on line 222 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/ab1074/public_html/6.php on line 225 INSERT INTO events VALUES('',1,UNIX_TIMESTAMP(),0,'This Weeks Anarchy 46 Winning Numbers Are: 11,25,27,31,38,42.The Results From Your 2 Lottery Tickets:Ticket Numbers: 6,21,29,38,40,46 -- 1 Matching Number(s) (no winnings)Ticket Numbers: 6,8,13,19,41,46 -- 0 Matching Number(s) (no winnings)You Won A Total Of $0.') Basically I(The ticket holder) did not recieve an event, it did not add nything to the lotterydone table, nor did it truncate the lotterytickets table, and i dont know what the 2 top errors mean. Can anyone help me. Here is the code in my cron: <?php require "7.php"; require "../../../../6.php"; global $c; $lotteryDetails = mysql_query("SELECT * FROM lotteryDetails"); $ld = mysql_fetch_assoc($lotteryDetails); $winNumbers = array(); for($i = 0; $i < 6; $i++) { $num = mt_rand(1,46); if(empty($winNumbers)) { array_push($winNumbers, $num); } else { while(in_array($num, $winNumbers)) { $num = mt_rand(1,46); } array_push($winNumbers, $num); } } sort($winNumbers); $wn = implode(",", $winNumbers); $getTickets = mysql_query("SELECT * FROM lotterytickets"); $jackpot = (mysql_num_rows($getTickets) * $ld['lotprice']) + $ld['lotjackpot']; $zero = 0; $one = 0; $two = 0; $three = 0; $four = 0; $five = 0; $six = 0; $users = array(); while($gt = mysql_fetch_assoc($getTickets)) { $yourNumbers = explode(",", $gt['numbers']); sort($yourNumbers); $uID = abs(@intval($gt['userid'])); if(empty($users)) { array_push($users, $uID); } else { if(!in_array($uID, $users)) { array_push($users, $uID); } } $correct = 0; foreach($yourNumbers as $yn) { if(in_array($yn, $winNumbers)) { $correct++; } } if($correct == 0) { $zero++; } if($correct == 1) { $one++; } if($correct == 2) { $two++; } if($correct == 3) { $three++; } if($correct == 4) { $four++; } if($correct == 5) { $five++; } if($correct == 6) { $six++; } $updateTicket = ("UPDATE lotterytickets SET correct = ". abs(@intval($correct)) ." WHERE id = ". abs(@intval($gt['id'])) .""); mysql_query($updateTicket) OR die("Could not update ticket ID ". $gt['id'] .": ". mysql_error()); } $potWin = array(); $countUsers = count($users); if(!empty($users)) { for($ui = 0; $ui < $countUsers; $ui++) { $selectCorrect = mysql_query("SELECT correct, id, userid, numbers FROM lotterytickets WHERE userid = ". abs(@intval($users[$ui])) .""); $event = "<b><u>This Weeks Anarchy 46 Winning Numbers Are: ". $wn .".</u> "; $event .= "The Results From Your ". abs(@intval(mysql_num_rows($selectCorrect))) ." Lottery Tickets: "; $nowin = array(0,1,2); $total = 0; while($sc = mysql_fetch_assoc($selectCorrect)) { $event .= "Ticket Numbers: ". mysql_real_escape_string($sc['numbers']) .""; if(in_array($sc['correct'], $nowin)) { $event .= "<i> -- ". $sc['correct'] ." Matching Number(s) (no winnings)</i> "; } else { if($sc['correct'] == 3) { $winnings = ($ld['lotprice'] + (floor($ld['lotprice'] * 0.5))); } if($sc['correct'] == 4) { $winnings = ($ld['lotprice'] + (floor($ld['lotprice'] * 0.8))); } if($sc['correct'] == 5) { $winnings = ($ld['lotprice'] + (floor($ld['lotprice'] * 1.4))); } if($sc['correct'] == 6) { $winnings = ($ld['lotprice'] + (floor($jackpot/$six))); array_push($potWin, $users[$ui]); } $event .= "<i> -- ". $sc['correct'] ." Matching Numbers (Won \$". number_format($winnings) .")</i> "; $total += $winnings; } } $event .= "You Won A Total Of \$". number_format($total) ."."; $subevent = mysql_real_escape_string(trim($event)); event_add($users[$ui], $subevent); $giveWinnings = ("UPDATE users SET water = water + ". abs(@intval($total)) ." WHERE userid = ". abs(@intval($users[$ui])) .""); mysql_query($giveWinnings) OR die("Could not give userid ". $ui ." Water: ". mysql_error()); } if(!empty($potWin)) { $winners = implode(",", $potWin); } elseif(empty($potWin)) { $winners = "NA"; } $insertDone = ("INSERT INTO lotterydone (ldID, ldNUMBERS, ldZERO, ldONE, ldTWO, ldTHREE, ldFOUR, ldFIVE, ldSIX, ldPOT, ldPOTWIN, ldTIME) VALUES('','". $wn ."', ". $zero .", ". $one .", ". $two .", ". $three .", ". $four .", ". $five .", ". $six .", ". $jackpot .", '". $winners ."', UNIX_TIMESTAMP())"); mysql_query($insertDone) OR die("Could not insert into lottery done: ". mysql_error()); if($six == 0) { $jp = $jackpot; } elseif($six > 0) { $jp = 0; } $updateJackpot = ("UPDATE lotteryDetails SET lotjackpot = ". abs(@intval($jp)) .""); mysql_query($updateJackpot) OR die("Could not update jackpot: ". mysql_error()); } else { event_add(1, "No Anarchy 46 Lottery Winner This Week."); } $truncate = ("TRUNCATE TABLE lotterytickets"); mysql_query($truncate) OR die("Could not truncate: ". mysql_error()); ?> Edited December 24, 2011 by Teh Sin Quote Link to comment Share on other sites More sharing options...
jay-dogg2009 Posted December 29, 2011 Share Posted December 29, 2011 is global_func.php included with in your cron as thats where the event add function is?? Quote Link to comment Share on other sites More sharing options...
lynm77 Posted February 3, 2012 Share Posted February 3, 2012 Hello All Has anyone managed to get the following Mod to work. I have all working but when with the cron provided i get the following error. Can someone please advise Parse error: syntax error, unexpected T_STRING in /home/swisou/public_html/cron_lottery.php on line 81 Quote Link to comment Share on other sites More sharing options...
lynm77 Posted February 3, 2012 Share Posted February 3, 2012 Hello Thank you Octarine that worked all is working now. Thank you again Quote Link to comment Share on other sites More sharing options...
boots Posted February 25, 2012 Share Posted February 25, 2012 (edited) After removing the magic_quotes i got this to work ok, but i also have a prob with the cron when i run the cron i get this error Parse error: syntax error, unexpected T_STRING in /home/bootson/public_html/mafia/cron_lottery.php on line 121 any help please You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Edited February 25, 2012 by boots Quote Link to comment Share on other sites More sharing options...
Newbie Posted February 25, 2012 Share Posted February 25, 2012 i just get a white blank screen when i run the cron Quote Link to comment Share on other sites More sharing options...
boots Posted February 26, 2012 Share Posted February 26, 2012 does your cron send a event ? Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted May 4, 2015 Share Posted May 4, 2015 Could anyone get the cron working? I've tried heaps of stuff with it. Nothing seems to work. I am using Ravans Script. And the mod worked but the cron returns a blank page, yes I know this is mean to happen but it.does not truncate the table nor send an even, can someone help me with this please? Quote Link to comment Share on other sites More sharing options...
jcvenom Posted May 4, 2015 Share Posted May 4, 2015 Could anyone get the cron working? I've tried heaps of stuff with it. Nothing seems to work. I am using Ravans Script. And the mod worked but the cron returns a blank page, yes I know this is mean to happen but it.does not truncate the table nor send an even, can someone help me with this please? Either your missing tables or functions, post your cron code here Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted May 4, 2015 Share Posted May 4, 2015 (edited) I'm getting this error now, can you help? You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Cron: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I completely removed line 105 now I'm getting this error You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Edited May 4, 2015 by -BRAIDZ- Quote Link to comment Share on other sites More sharing options...
NonStopCoding Posted May 4, 2015 Share Posted May 4, 2015 delete the first 2 lines after <?php and add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. see if that helps that from the latest version of mccodes i believe this mod was coded for the older version of mccodes Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted May 4, 2015 Share Posted May 4, 2015 delete the first 2 lines after <?php and add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. see if that helps that from the latest version of mccodes i believe this mod was coded for the older version of mccodes Still nothing, I honestly reckon someone with the time on their hands is going.to have to remake the cron. I'm no good at that stuff. But I'm alright at converting from V1 to V2 that's piss easy haha. But no I have to take some classes in Web design. I just really want this mod to work without manually having to do the draws.. Quote Link to comment Share on other sites More sharing options...
TheMasterGeneral Posted May 5, 2015 Share Posted May 5, 2015 Looks like you missed a $db, [MENTION=68406]-BRAIDZ-[/MENTION] The second error looks like you either don't have a password set, or you don't have access to the truncate command. Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted May 5, 2015 Share Posted May 5, 2015 Looks like you missed a $db, [MENTION=68406]-BRAIDZ-[/MENTION] The second error looks like you either don't have a password set, or you don't have access to the truncate command. I figured out the DB issue but had to remove the event add saying there was no winner, it was saying there was an error it was on line 103 I think You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted May 5, 2015 Share Posted May 5, 2015 If you are using V2 then you should convert it over to V2 instead of a hybrid version of it. You may yield some better results 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.