Jump to content
MakeWebGames

-BRAIDZ-

Members
  • Posts

    403
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by -BRAIDZ-

  1. This is a Cron I have for my lottery, and it returns a blank page, and does add an even and the lottery pot stays the same, any help would be great thanks! Where am I screwing up?   <?php include ("./config.php"); global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; include("./global_func.php"); $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>The winning numbers are: ". $wn .".</u></b>"; $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 .= " <b>Ticket numbers: ". mysql_real_escape_string($sc['numbers']) ."</b>"; 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) .".<hr />"; $subevent = mysql_real_escape_string(trim($event)); event_add($users[$ui], $subevent); $giveWinnings = ("UPDATE users SET money = money + ". abs(@intval($total)) ." WHERE userid = ". abs(@intval($users[$ui])) .""); mysql_query($giveWinnings) OR die("Could not give userid ". $ui ." money: ". 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 lottery this week. <img src="images/smilies/frown.png" border="0" alt="" title="Frown" class="inlineimg" />"); } $truncate = ("TRUNCATE TABLE lotterytickets"); mysql_query($truncate) OR die("Could not truncate: ". mysql_error()); ?>   - - - Updated - - - Here is the lottery mod <?php include_once(DIRNAME(__FILE__) ."/globals.php"); ?> <script language = "javascript" type = "text/javascript"> var ticked = new Array(); function tickBox(val) { var theid = "id" + val; if(document.getElementById(theid).checked == true) { ticked.push(theid); } else if(document.getElementById(theid).checked == false) { for(var sp = 0; sp < ticked.length; sp++) { if(ticked[sp] == theid) { ticked.splice(sp,1); } } } if(ticked.length >= 6) { for(var count = 1; count < 47; count++) { var countID = "id" + count; if(document.getElementById(countID).checked == false) { document.getElementById(countID).disabled = true; } document.getElementById("submit").disabled = false; } } else if(ticked.length < 6) { for(var count = 1; count < 47; count++) { var countID = "id" + count; document.getElementById(countID).disabled = false; } document.getElementById("submit").disabled = true; } } function formReset() { for(var n = 1; n < 47; n++) { var id = "id" + n; document.getElementById(id).checked = false; document.getElementById(id).disabled = false; } document.getElementById("dip").disabled = false; document.getElementById("submit").disabled = true; document.getElementById("luckysub").checked = false; document.getElementById("hiddenNums").value = ""; ticked.splice(0,ticked.length); } function luckyDip() { var luckyarr = new Array(); for(var d = 1; d < 47; d++) { var did = "id" + d; document.getElementById(did).checked = false; document.getElementById(did).disabled = true; } for(var c = 1; c < 7; c++) { var box = Math.floor((46)*Math.random()) + 1; var boxid = "id" + box; if(document.getElementById(boxid).checked == false) { document.getElementById(boxid).checked = true; luckyarr.push(box); } else { box = Math.floor((46)*Math.random()) + 1; boxid = "id" + box; while(document.getElementById(boxid).checked == true) { box = Math.floor((46)*Math.random()) + 1; boxid = "id" + box; } document.getElementById(boxid).checked = true; luckyarr.push(box); } } document.getElementById("dip").disabled = true; document.getElementById("luckysub").checked = true; document.getElementById("submit").disabled = false; document.getElementById("hiddenNums").value = luckyarr; } </script> <style type = "text/css"> .lotnum { width: 100%; text-align: center; font-size: 10px; } .luckdip { background-color: #E66C2C; color: #000000; } .odd { background-color: #306EFF; } .even { background-color: #4AA02C; } #bought { font-size: 20px; font-weight: bold; font-variant: small-caps; } </style> <?php $lotteryDetails = mysql_query("SELECT * FROM lotteryDetails"); $lD = mysql_fetch_object($lotteryDetails); define('TICKETCOST', $lD->lotprice=10000); define('LIMIT', $lD->lotlimit=50000); if(!$_POST['submit']) { $all = mysql_query("SELECT id FROM lotterytickets"); $numall = mysql_num_rows($all); $jackpot = ($numall * TICKETCOST) + $lD->lotjackpot; $yourTicks = mysql_query("SELECT id FROM lotterytickets WHERE userid = ". abs(@intval($ir['userid'])) .""); $numYourTicks = mysql_num_rows($yourTicks); print "<div align = 'center'>"; print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> Lottery </h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'><br> <br><br> It will cost you \$". number_format(TICKETCOST) ." to buy one lottery ticket, and you can only have ". number_format(LIMIT) ." tickets at any one time.</p>"; $grammar = ($numYourTicks != 1) ? "tickets" : "ticket"; print "You currently have ". number_format($numYourTicks) ." ". $grammar .".</p>"; print " The current jackpot is at \$". number_format($jackpot) .".</p>"; print " Select 6 numbers from below or click on Lucky Dip to have them randomly chosen for you!</p>"; print "<form action = 'lottery.php' method = 'POST' name = 'boxes'>"; print "<table class = 'lotnum'>"; $rows = 0; $value = 1; while($rows <= 10) { print "<tr>"; $cols = 0; while($cols <= 4) { $colclass = $cols+1; $class = ($value % 2 == 0) ? "even" : "odd"; if($value <= 46) { $id = "id".$value; print "<td class = '". $class ."'>". $value ." <input type = 'checkbox' name = 'numbers[]' id = '". $id ."' value = '". $value ."' onClick = \"tickBox(this.value);\" /></td>"; $value++; $cols++; } else { $cols++; } } print "</tr>"; $rows++; } print " <tr> <td><input type = 'button' name = 'lucky' id = 'dip' value = 'Lucky Dip' onClick = \"luckyDip();\" /></td> <td><input type = 'button' name = 'resetForm' id = 'resetForm' value = 'Reset' onClick = \"formReset();\" /></td> <td colspan = '2'><input type = 'submit' name = 'submit' id = 'submit' value = 'Buy Ticket' disabled = 'disabled' /></td> <td class = 'luckdip'>Lucky Dip<input type = 'checkbox' name = 'luckysub' value = 'lucky' id = 'luckysub' disabled = 'disabled' /></td> </tr>"; print "</table> <input type = 'hidden' id = 'hiddenNums' name = 'hiddenNums' value = '' /> </form>"; print "</div>"; } else { $tickets = mysql_query("SELECT userid FROM lotterytickets WHERE userid = ". abs(@intval($ir['userid'])) .""); if($_POST['hiddenNums'] == '') { $countNums = count($_POST['numbers']); $numbers = $_POST['numbers']; $lucky = ""; $dip = 0; } elseif($_POST['hiddenNums'] != '') { $explode = explode(",",$_POST['hiddenNums']); $countNums = count($explode); $numbers = $explode; $lucky = "Lucky Dip"; $dip = 1; } if($countNums != 6 || empty($numbers)) { print " You either didn't select any numbers or you didn't select 6 numbers.</p> <a href = 'lottery.php'>Back</a></p>"; } elseif($ir['money'] < TICKETCOST) { print " You need to have \$". number_format(TICKETCOST) ." to buy a lottery ticket.</p> <a href = 'lottery.php'>Back</a></p>"; } elseif(mysql_num_rows($tickets) >= LIMIT) { print " You can only have ". number_format(LIMIT) ." lottery tickets at once.</p> <a href = 'lottery.php'>Back</a></p>"; } else { sort($numbers); $punct = 0; $store = ""; print "<p id = 'bought'>Ticket bought!</p>"; print " Your ". $lucky ." numbers are: "; for($i = 0; $i < $countNums; $i++) { $n = abs(@intval($numbers[$i])); if($punct == 5) { $ender = "."; $store .= $n; } else { $ender = ", "; $store .= $n .","; } print $n . $ender; $punct++; } print "</p>"; print " <a href = 'lottery.php'>Back</a></p>"; $insertTicket = ("INSERT INTO lotterytickets (id, userid, numbers, bought, luckydip) VALUES('',". abs(@intval($ir['userid'])) .", '". mysql_real_escape_string($store) ."', UNIX_TIMESTAMP(), ". abs(@intval($dip)) .")"); mysql_query($insertTicket) OR die("Could not insert ticket: ". mysql_error()); $takeMoney = ("UPDATE users SET money = money - ". abs(@intval(TICKETCOST)) ." WHERE userid = ". abs(@intval($ir['userid'])) .""); mysql_query($takeMoney) OR die("Could not take money: ". mysql_error()); } } $h->endpage(); ?>
  2. Message me for details, and also looking for active players
  3. I am looking for a Mod to add to my game, I have in my staff panel "Create Organised Crimes" but no link in my gang to start them, can anyone.help me please?
  4. If it is illegal why the fuck are they still selling it?
  5. This is a paid for version of Ravans, i done it exactly the way i uploaded it last time and had no problems last time so i dont know why i am now?
  6. Hey there I have just reset my game because crons have not been working so i delete everything from my cPanel, now ive put it all back on and I go to my website and try to do the installer, but it tells me that the Game File is not writable, but i dont see why its not writable because ive chmomed all files and folders to 777, am i doing this wrong? Someone please help me
  7. yeah i sure can mate
  8. ok will do that, this is really starting to piss me off them not working they was working fine a few weeks ago now they arent at all
  9. Nope, is there any other ways?
  10. of course i did, and my game runs off ravans mafia script
  11. Just tried that, not working
  12. add it like this? 'code' => '4d3eb406484f4ca520c42a120974ab8b' thats the way it is in config.php or just enter code= 4d3eb406484f4ca520c42a120974ab8b
  13. Hey there everyone ive been having a problem with my crons working on my game and was wondering if maybe i could please get a little help getting them running, i am using curl commands, but not sure if i am entering them right, i will give you an example of what im doing */5 * * * * curl htttp://yoursite.com/cron_run_five.php is this correct or do i need to add something else to the command with the curl?
  14. Ok thanks champ, also what is the best free Game Engine too use?
  15. If i want to change game engines will it be easy? and will i lose all my users? I want to change from Ravans Mafia Script's too something better, but i dont know what other better ones there is out there? Can someone help me please?
  16. ok i have a lot of work to do, spose its bed time for me now though goodnight will give it a go in the morning lol :)
  17. im backing up all the data from my cpanel now going to give it a shot at using a different engine if not then go back then get a better script
  18. ok but do i have to delete all the data off my cPanel? cause i dont really want to loose all my players
  19. if i use a different engine will it still work on the same cpanel just delete all the other stuff on there and upload the new things?
  20. well in all honesty i do but, not when i get the money to create a better game
  21. Im not giving out the URL to my game as apparently its an illegal code and dont want my game shut down
  22. Cheers, well i play this other game with the same code and its beem up for over a year hasnt been shut down, i will just see how it goes, but also start working on my own game,
  23. as i said the game was given to me so i dont really care, it has hosting for 2 years, and for that 2 years im going to be working on creating my own game and get that up and running, also, if i cant code too well how much money would it cost me to get a game coded? and in australian money to be precise
  24. Tell me why they have a website then where you can buy the script? i had my game given to me, so i had to download a nulled version of the script heres the link to the original, and to the other person about me not having knowledge and whatever else, and not wanting to learn how to program, well for starters i dont want to know how to program, i know some html and php still learning, URL REMOVED
×
×
  • Create New...