
Greenslip
Members-
Posts
12 -
Joined
-
Last visited
Greenslip's Achievements
Newbie (1/14)
0
Reputation
-
Thanks Tangled... Anybody out there that can help with this.. Thanks in advance...
-
Thanks Tangled, This is exactly what I'm looking for, just don't know if it's on this forum our not. I can't find it and don't know what it was named..
-
Kyle this is what I'm looking for with the rules.. Thanks lucky for putting the correct rules out here for me..
-
I meant there is 25 briefcases to pick from. You pick one you wanna keep for yourself. As you play long there is a option to trade your briefcase for what is offered. Many games have this and I'd like to have it for my game. Please help me find this, just haven't found it on here or know what is called..
-
I have been to many games and noticed they have a Briefcase game like Deal or No Deal. I'm not sure what it is called or if it's on this forum, but any advice would be greatly appreciated in finding this. Thanks in advance..
-
can you post what I'm suppose to put, I'm a little confused on what your telling me. Do I post what is in the class file or what is in the competition cron file into my daily cron..
-
I haven't edited anything on that but here it is.. <?php /* */ if(!defined('MONO_ON')) { exit; } if (!extension_loaded('mysql')) { if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { dl('php_mysql.dll'); } else { dl('mysql.so'); } } class database { var $host; var $user; var $pass; var $database; var $persistent=0; var $last_query; var $result; var $connection_id; var $num_queries=0; var $start_time; function configure($host, $user, $pass, $database, $persistent=0) { $this->host=$host; $this->user=$user; $this->pass=$pass; $this->database=$database; $this->persistent=$persistent; return 1; //Success. } function connect() { if(!$this->host) { $this->host="localhost"; } if(!$this->user) { $this->user="root"; } if($this->persistent) { $this->connection_id=mysql_pconnect($this->host, $this->user, $this->pass) or $this->connection_error(); } else { $this->connection_id=mysql_connect($this->host, $this->user, $this->pass, 1) or $this->connection_error(); } mysql_select_db($this->database, $this->connection_id); return $this->connection_id; } function disconnect() { if($this->connection_id) { mysql_close($this->connection_id); $this->connection_id=0; return 1; } else { return 0; } } function change_db($database) { mysql_select_db($database, $this->connection_id); $this->database=$database; } function query($query) { $this->last_query=$query; $this->num_queries++; $this->result=mysql_query($this->last_query, $this->connection_id) or $this->query_error(); return $this->result; } function fetch_row($result=0) { if(!$result) { $result=$this->result; } return mysql_fetch_assoc($result); } function num_rows($result=0) { if(!$result) { $result=$this->result; } return mysql_num_rows($result); } function insert_id() { return mysql_insert_id($this->connection_id); } function connection_error() { die("<b>FATAL ERROR:</b> Could not connect to database on {$this->host} (".mysql_error().")"); } function query_error() { die("<b>QUERY ERROR:</b> ".mysql_error()."<br /> Query was {$this->last_query}"); } function fetch_single($result=0) { if(!$result) { $result=$this->result; } return mysql_result($result, 0, 0); } function event_add($user, $event) { //event should be pre-escaped. $this->query("INSERT INTO `event` VALUES('', {$user}, '{$event}', unix_timestamp(), 0)"); $this->query("INSERT INTO `event_log` VALUES('', {$user}, '{$event}', unix_timestamp())"); $this->query("UPDATE `user` SET new_events=new_events+1 WHERE userid={$user}"); } function mymicro() { $m=explode(" ", microtime()); return $m[0]+$m[1]; } function clock_start() { $this->start_time=$this->mymicro(); } function clock_end() { $t=$this->mymicro(); return round($t-$this->start_time, 4); } function clean_input($in) { $in=stripslashes($in); return str_replace(array("<",">",'"',"'","\n"), array("<",">",""","'","<br />"), $in); } function clean_input_nohtml($in) { $in=stripslashes($in); return str_replace(array("'"), array("'"), $in); } function clean_input_nonform($in) { return addslashes($in); } function easy_insert($table, $data) { $query="INSERT INTO `$table` ("; $i=0; foreach($data as $k => $v) { $i++; if($i > 1) { $query.=", "; } $query.=$k; } $query.=") VALUES("; $i=0; foreach($data as $k => $v) { $i++; if($i > 1) { $query.=", "; } $query.="'".addslashes($v)."'"; } $query.=")"; return $this->query($query); } function make_integer($str, $positive=1) { $str = (string) $str; $ret = ""; for($i=0;$i<strlen($str);$i++) { if((ord($str[$i]) > 47 && ord($str[$i]) < 58) or ($str[$i]=="-" && $positive == 0)) { $ret.=$str[$i]; } } if(strlen($ret) == 0) { return "0"; } return $ret; } function unhtmlize($text) { return str_replace("<br />","\n", $text); } function escape($text) { return mysql_real_escape_string($text, $this->connection_id); } function affected_rows($conn = NULL) { return mysql_affected_rows($this->connection_id); } } ?>
-
Here is my config.php file <?php $_CONFIG = array( 'hostname' => 'localhost', 'username' => '111111', 'password' => '111111', 'database' => '111111', 'persistent' => 0, 'driver' => 'mysql', 'code' => 'I delete this for my security' ); ?> sorry not sure how to add tags on here..
-
So I checked my error messages from my cron email. here is what it says.. % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0 100 159 100 159 0 0 93 0 0:00:01 0:00:01 --:--:-- 229 100 159 100 159 0 0 93 0 0:00:01 0:00:01 --:--:-- 229 <br /> <b>Fatal error</b>: Call to a member function query() on a non-object in <b>/home/firstmob/public_html/competition_cron.php</b> on line <b>9</b><br />
-
ok this is how i have the code set up for competition_cron.php. I want it to update at server reset on a daily basis. So this is the command I put into my cron manager. <?php /* * Competition System * Free Modification * DidNotCompute - [url]http://makewebgames.io/member.php/70333-DidNotCompute[/url] */ 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; $set = array(); $settq = $db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } if ($set['competition'] == "Active") { if ($set['competition_type'] == "Crimes") { $type = "crimes"; } elseif ($set['competition_type'] == "Jail Busts") { $type = "jail_busts"; } $get_top3 = $db->query("SELECT userid, $type, competition_starting FROM users WHERE competition='1' ORDER BY $type-competition_starting DESC LIMIT 3"); $n = 1; while ($top3 = mysql_fetch_object($get_top3)) { switch ($n) { case 1: $prize = $set['competition_prize_1']; break; case 2: $prize = $set['competition_prize_2']; break; case 3: $prize = $set['competition_prize_3']; break; } $db->query("UPDATE users SET money=money+$prize WHERE userid='$top3->userid'"); $n++; } $db->query("UPDATE users SET competition='0' WHERE competition='1'"); $db->query("UPDATE settings SET conf_value='Inactive' WHERE conf_name='competition'"); $db->query("UPDATE settings SET conf_value='' WHERE conf_name='competition_type'"); $db->query("UPDATE settings SET conf_value='' WHERE conf_name='competition_prize_1'"); $db->query("UPDATE settings SET conf_value='' WHERE conf_name='competition_prize_2'"); $db->query("UPDATE settings SET conf_value='' WHERE conf_name='competition_prize_3'"); } ?> - - - Updated - - - oops sorry I put in this command for the cron manager. 0 0 * * * curl http://www.firstmobsterwar.net/competition_cron.php?code=
-
0 0 * * * curl http://www.mywebsitehere.net/competition_cron.php?code= my code here.... using mcc version 2.0
-
I added this to my game and works fine except for the cron. I did curl the file and added my code behind the command line. This also happens with your lottery system mod. Any ideas how i can make it work properly..