Jump to content
MakeWebGames

this cron doesnt trigger lottery


thebobby

Recommended Posts


<?php
// Created, and released for free for the MWG (makewebgames.io) community by Kieran-R

include "config.php";
include "global_func.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;
$set=array();
$settq=$db->query("SELECT * FROM settings");
while($r=$db->fetch_row($settq))
{
$set[$r['conf_name']]=$r['conf_value'];
}

//Money Lotto
$ticketssold=$db->num_rows($db->query("SELECT * FROM moneylotto"));
$payout=($ticketssold*50000)*0.90;
$rand=rand(1,$ticketssold);
$win=$db->query("SELECT * FROM moneylotto where ticketid=$rand");
$winner = mysql_fetch_array($win);
event_add($winner['userid'],"Congratulations! You have won the weekly lottery, and claimed your ".money_formatter($payout)." reward!",$c);
$db->query("INSERT INTO announcements VALUES('User ID {$winner['userid']} won the weekly lottery. Well done!', unix_timestamp())");
$db->query("UPDATE users SET new_announcements=new_announcements+1");
$db->query("UPDATE users SET bankmoney=bankmoney+$payout WHERE userid={$winner['userid']}");
$db->query("TRUNCATE TABLE moneylotto");
$db->query("INSERT INTO moneylottowinners (id, winner, amount) VALUES ('', '{$winner['userid']}', '$payout')");
//Money Lotto End

//Points Lotto
$ticketssold=$db->num_rows($db->query("SELECT * FROM pointslotto"));
$payout=($ticketssold*50)*0.90;
$rand=rand(1,$ticketssold);
$win=$db->query("SELECT * FROM pointslotto where ticketid=$rand");
$winner=$db->fetch_array($win);
event_add($winner['userid'],"Congratulations! You have won the weekly points lottery, and claimed your $payout points reward!",$c);
$db->query("UPDATE users SET crystals=crystals+$payout WHERE userid={$winner['userid']}");
$db->query("TRUNCATE TABLE pointslotto");
$db->query("INSERT INTO pointslottowinners (id, winner, amount) VALUES ('', '{$winner['userid']}', '$payout')");
//Points Lotto End

?>


Link to comment
Share on other sites

when you use the curl, you have to make sure you include the ?code= at the end. The code will be in your config.php file

So in the end you will have curl http://mafiasfinest.com/lotterycron.php?code=addcodehere

otherwise nothing will run, due to the code on line 4: if($_GET['code'] != $_CONFIG['code']) { die(""); }

You can comment that line out for testing purposes, but make sure you add in the previous bit to the curl.

Link to comment
Share on other sites

Warning: require(../class/class_db_mysql.php) [function.require]: failed to open stream: No such file or directory in /home/mafiasfi/public_html/lotterycron.php on line 9

Fatal error: require() [function.require]: Failed opening required '../class/class_db_mysql.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mafiasfi/public_html/lotterycron.php on line 9

<?php

// Created, and released for free for the MWG (makewebgames.io) community by Kieran-R

include "config.php";

include "global_func.php";

global $_CONFIG;

if($_GET['code'] != $_CONFIG['code']) { die(""); }

define("MONO_ON", 1);

require "../class/class_db_{$_CONFIG['driver']}.php"; line 9

$db=new database;

$db->configure($_CONFIG['hostname'],

$_CONFIG['username'],

$_CONFIG['password'],

$_CONFIG['database'],

$_CONFIG['persistent']);

$db->connect();

$c=$db->connection_id;

$set=array();

$settq=$db->query("SELECT * FROM settings");

while($r=$db->fetch_row($settq))

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...