Jump to content
MakeWebGames

V2 Education days go negative


illegalife
 Share

Recommended Posts

I dont know whats wrong my education days go negative... this is my cron_day.php

 

<?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;
$db->query("UPDATE fedjail set fed_days=fed_days-1");
$q2=$db->query("SELECT * FROM fedjail WHERE fed_days=0");
$ids=array();
while($r2=$db->fetch_row($q2))
{
$ids[]=$r2['fed_userid'];
}
if(count($ids) > 0)
{
$db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")");
}
$db->query("DELETE FROM fedjail WHERE fed_days=0");
$db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0");
$db->query("UPDATE users SET splatturns=3");
$db->query("UPDATE users SET strategoturns=0");
$db->query("UPDATE users SET tokens=0");
$db->query("UPDATE users SET brothel=0",$c);
$db->query("UPDATE users SET turns=25");
$db->query("UPDATE users SET tired=0");
$db->query("UPDATE users SET dare=5");
$db->query("UPDATE users SET popularity=2");
$db->query("UPDATE users SET clubvisits=0");
$db->query("UPDATE users SET happiness=happiness-1 WHERE married != 0");
$db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0");
$db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0");
$db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0");
$db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0");
$db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0 AND cdays > 0");
$db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0");
$db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0");
$q2=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0");
while($r2=$db->fetch_row($q2))
{
$cd=$db->query("SELECT * FROM courses WHERE crID={$r2['course']}");
$coud=$db->fetch_row($cd);
$userid=$r2['userid'];
$db->query("INSERT INTO coursesdone VALUES({$r2['userid']},{$r2['course']})");
$upd="";
$ev="";
if($coud['crSTR'] > 0)
{
$upd.=",us.strength=us.strength+{$coud['crSTR']}";
$ev.=", {$coud['crSTR']} strength";
}
if($coud['crGUARD'] > 0)
{
$upd.=",us.guard=us.guard+{$coud['crGUARD']}";
$ev.=", {$coud['crGUARD']} guard";
}
if($coud['crLABOUR'] > 0)
{
$upd.=",us.labour=us.labour+{$coud['crLABOUR']}";
$ev.=", {$coud['crLABOUR']} labour";
}
if($coud['crAGIL'] > 0)
{
$upd.=",us.agility=us.agility+{$coud['crAGIL']}";
$ev.=", {$coud['crAGIL']} agility";
}
if($coud['crIQ'] > 0)
{
$upd.=",us.IQ=us.IQ+{$coud['crIQ']}";
$ev.=", {$coud['crIQ']} IQ";
}
$ev=substr($ev,1);
if ($upd) {
$db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid");
}
$db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')");
}
$db->query("UPDATE factions SET faCHOURS=faCHOURS-1 WHERE faCRIME>0");
$q=$db->query("SELECT fa.*,oc.* FROM factions fa LEFT JOIN orgcrimes oc ON fa.faCRIME=oc.ocID WHERE fa.faCRIME > 0 AND fa.faCHOURS = 0");
while($r=$db->fetch_row($q))
{
$suc=rand(0,1);
if($suc) {
$log=$r['ocSTARTTEXT'].$r['ocSUCCTEXT'];
$muny=(int) (rand($r['ocMINMONEY'],$r['ocMAXMONEY']));
$log=str_replace(array("{muny}","'"),array($muny,"''"),$log);
$db->query("UPDATE factions SET faVAULT=faVAULT+$muny,faCRIME=0 WHERE faID={$r['faID']}");
$db->query("INSERT INTO oclogs VALUES ('',{$r['ocID']},{$r['faID']}, '$log', 'success', $muny, '{$r['ocNAME']}', unix_timestamp())");
$i=$db->insert_id();
$qm=$db->query("SELECT * FROM users WHERE factions={$r['faID']}");
while($rm=$db->fetch_row($qm))
{
event_add($rm['userid'],"Your Gang's Organised Crime Succeeded. Go [url='oclofa.php?ID=$i']here[/url] to view the details.",$c);
}
}
else
{
$log=$r['ocSTARTTEXT'].$r['ocGANGTEXT'];
$muny=0;
$log=str_replace(array("{muny}","'"),array($muny,"''"),$log);
$db->query("UPDATE factions SET faCRIME=0 WHERE faID={$r['gaID']}");
$db->query("INSERT INTO oclogs VALUES ('',{$r['ocID']},{$r['gaID']}, '$log', 'failure', $muny, '{$r['ocNAME']}', unix_timestamp())");
$i=$db->insert_id();
$qm=$db->query("SELECT * FROM users WHERE gang={$r['gaID']}");
while($rm=$db->fetch_row($qm))
{
event_add($rm['userid'],"Your Gang's Organised Crime Failed. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c);
}
}
}
$db->query("UPDATE users SET course=0 WHERE cdays=0");
$db->query("TRUNCATE TABLE votes");
$fo=fopen("jailshouts.txt","w");
fclose($fo);
?>
Link to comment
Share on other sites

Re: V2 Education days go negative

ok here's how i changed it

 

<?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;
$db->query("UPDATE fedjail set fed_days=fed_days-1");
$q2=$db->query("SELECT * FROM fedjail WHERE fed_days=0");
$ids=array();
while($r2=$db->fetch_row($q2))
{
$ids[]=$r2['fed_userid'];
}
if(count($ids) > 0)
{
$db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")");
}
$db->query("DELETE FROM fedjail WHERE fed_days=0");
$db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0");
$db->query("UPDATE users SET splatturns=3");
$db->query("UPDATE users SET strategoturns=0");
$db->query("UPDATE users SET tokens=0");
$db->query("UPDATE users SET brothel=0",$c);
$db->query("UPDATE users SET turns=25");
$db->query("UPDATE users SET tired=0");
$db->query("UPDATE users SET dare=5");
$db->query("UPDATE users SET popularity=2");
$db->query("UPDATE users SET clubvisits=0");
$db->query("UPDATE users SET happiness=happiness-1 WHERE married != 0");
$db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0");
$db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0");
$db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0");
$db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0");
$db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0");
$db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0");
$q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0");
while($r2=$db->fetch_row($q2))
{
$cd=$db->query("SELECT * FROM courses WHERE crID={$r2['course']}");
$coud=$db->fetch_row($cd);
$userid=$r2['userid'];
$db->query("INSERT INTO coursesdone VALUES({$r2['userid']},{$r2['course']})");
$upd="";
$ev="";
if($coud['crSTR'] > 0)
{
$upd.=",us.strength=us.strength+{$coud['crSTR']}";
$ev.=", {$coud['crSTR']} strength";
}
if($coud['crGUARD'] > 0)
{
$upd.=",us.guard=us.guard+{$coud['crGUARD']}";
$ev.=", {$coud['crGUARD']} guard";
}
if($coud['crLABOUR'] > 0)
{
$upd.=",us.labour=us.labour+{$coud['crLABOUR']}";
$ev.=", {$coud['crLABOUR']} labour";
}
if($coud['crAGIL'] > 0)
{
$upd.=",us.agility=us.agility+{$coud['crAGIL']}";
$ev.=", {$coud['crAGIL']} agility";
}
if($coud['crIQ'] > 0)
{
$upd.=",us.IQ=us.IQ+{$coud['crIQ']}";
$ev.=", {$coud['crIQ']} IQ";
}
$ev=substr($ev,1);
if ($upd) {
$db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid");
}
$db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')");
}
$db->query("UPDATE users SET course=0 WHERE cdays=0");
$db->query("TRUNCATE TABLE votes");
$fo=fopen("jailshouts.txt","w");
fclose($fo);
?>

 

will it work now? and for some reason this

$db->query("TRUNCATE TABLE votes");

didnt work either

Link to comment
Share on other sites

Re: V2 Education days go negative

don't doubt it...you miss understood..

I was saying you had the same thing in there 2 times.

and you took out the wrong one...

Try this..

 

<?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;
$db->query("UPDATE fedjail set fed_days=fed_days-1");
$q2=$db->query("SELECT * FROM fedjail WHERE fed_days=0");
$ids=array();
while($r2=$db->fetch_row($q2))
{
$ids[]=$r2['fed_userid'];
}
if(count($ids) > 0)
{
$db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")");
}
$db->query("DELETE FROM fedjail WHERE fed_days=0");
$db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0");
$db->query("UPDATE users SET splatturns=3");
$db->query("UPDATE users SET strategoturns=0");
$db->query("UPDATE users SET tokens=0");
$db->query("UPDATE users SET brothel=0",$c);
$db->query("UPDATE users SET turns=25");
$db->query("UPDATE users SET tired=0");
$db->query("UPDATE users SET dare=5");
$db->query("UPDATE users SET popularity=2");
$db->query("UPDATE users SET clubvisits=0");
$db->query("UPDATE users SET happiness=happiness-1 WHERE married != 0");
$db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0");
$db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0");
$db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0");
$db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0 AND cdays > 0");
$db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0");
$db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0");
$q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0");
while($r2=$db->fetch_row($q2))
{
$cd=$db->query("SELECT * FROM courses WHERE crID={$r2['course']}");
$coud=$db->fetch_row($cd);
$userid=$r2['userid'];
$db->query("INSERT INTO coursesdone VALUES({$r2['userid']},{$r2['course']})");
$upd="";
$ev="";
if($coud['crSTR'] > 0)
{
$upd.=",us.strength=us.strength+{$coud['crSTR']}";
$ev.=", {$coud['crSTR']} strength";
}
if($coud['crGUARD'] > 0)
{
$upd.=",us.guard=us.guard+{$coud['crGUARD']}";
$ev.=", {$coud['crGUARD']} guard";
}
if($coud['crLABOUR'] > 0)
{
$upd.=",us.labour=us.labour+{$coud['crLABOUR']}";
$ev.=", {$coud['crLABOUR']} labour";
}
if($coud['crAGIL'] > 0)
{
$upd.=",us.agility=us.agility+{$coud['crAGIL']}";
$ev.=", {$coud['crAGIL']} agility";
}
if($coud['crIQ'] > 0)
{
$upd.=",us.IQ=us.IQ+{$coud['crIQ']}";
$ev.=", {$coud['crIQ']} IQ";
}
$ev=substr($ev,1);
if ($upd) {
$db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid");
}
$db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')");
}
$db->query("TRUNCATE TABLE votes");
$fo=fopen("jailshouts.txt","w");
fclose($fo);
?>
Link to comment
Share on other sites

Re: V2 Education days go negative

 

don't doubt it...you miss understood..

I was saying you had the same thing in there 2 times.

and you took out the wrong one...

Try this..

 

<?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;
$db->query("UPDATE fedjail set fed_days=fed_days-1");
$q2=$db->query("SELECT * FROM fedjail WHERE fed_days=0");
$ids=array();
while($r2=$db->fetch_row($q2))
{
$ids[]=$r2['fed_userid'];
}
if(count($ids) > 0)
{
$db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")");
}
$db->query("DELETE FROM fedjail WHERE fed_days=0");
$db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0");
$db->query("UPDATE users SET splatturns=3");
$db->query("UPDATE users SET strategoturns=0");
$db->query("UPDATE users SET tokens=0");
$db->query("UPDATE users SET brothel=0",$c);
$db->query("UPDATE users SET turns=25");
$db->query("UPDATE users SET tired=0");
$db->query("UPDATE users SET dare=5");
$db->query("UPDATE users SET popularity=2");
$db->query("UPDATE users SET clubvisits=0");
$db->query("UPDATE users SET happiness=happiness-1 WHERE married != 0");
$db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0");
$db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0");
$db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0");
$db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0 AND cdays > 0");
$db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0");
$db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0");
$q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0");
while($r2=$db->fetch_row($q2))
{
$cd=$db->query("SELECT * FROM courses WHERE crID={$r2['course']}");
$coud=$db->fetch_row($cd);
$userid=$r2['userid'];
$db->query("INSERT INTO coursesdone VALUES({$r2['userid']},{$r2['course']})");
$upd="";
$ev="";
if($coud['crSTR'] > 0)
{
$upd.=",us.strength=us.strength+{$coud['crSTR']}";
$ev.=", {$coud['crSTR']} strength";
}
if($coud['crGUARD'] > 0)
{
$upd.=",us.guard=us.guard+{$coud['crGUARD']}";
$ev.=", {$coud['crGUARD']} guard";
}
if($coud['crLABOUR'] > 0)
{
$upd.=",us.labour=us.labour+{$coud['crLABOUR']}";
$ev.=", {$coud['crLABOUR']} labour";
}
if($coud['crAGIL'] > 0)
{
$upd.=",us.agility=us.agility+{$coud['crAGIL']}";
$ev.=", {$coud['crAGIL']} agility";
}
if($coud['crIQ'] > 0)
{
$upd.=",us.IQ=us.IQ+{$coud['crIQ']}";
$ev.=", {$coud['crIQ']} IQ";
}
$ev=substr($ev,1);
if ($upd) {
$db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid");
}
$db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')");
}
$db->query("TRUNCATE TABLE votes");
$fo=fopen("jailshouts.txt","w");
fclose($fo);
?>

 

 

What happens now is that it just stops at

You are currently doing the Hacking Course, you have 0 days remaining.

and nothing happens

Link to comment
Share on other sites

Re: V2 Education days go negative

 

<?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;
$db->query("UPDATE fedjail set fed_days=fed_days-1");
$q2=$db->query("SELECT * FROM fedjail WHERE fed_days=0");
$ids=array();
while($r2=$db->fetch_row($q2))
{
$ids[]=$r2['fed_userid'];
}
if(count($ids) > 0)
{
$db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")");
}
$db->query("DELETE FROM fedjail WHERE fed_days=0");
$db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0");
$db->query("UPDATE users SET splatturns=3");
$db->query("UPDATE users SET strategoturns=0");
$db->query("UPDATE users SET tokens=0");
$db->query("UPDATE users SET brothel=0",$c);
$db->query("UPDATE users SET turns=25");
$db->query("UPDATE users SET tired=0");
$db->query("UPDATE users SET dare=5");
$db->query("UPDATE users SET popularity=2");
$db->query("UPDATE users SET clubvisits=0");
$db->query("UPDATE users SET happiness=happiness-1 WHERE married != 0");
$db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0");
$db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0");
$db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0");
$db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0 AND cdays > 0");
$db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0");
$db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0");
$q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0");
while($r2=$db->fetch_row($q2))
{
$cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}");
$coud=$db->fetch_row($cd);
$userid=$r2['userid'];
$db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})");
$upd="";
$ev="";
if($coud['crSTR'] > 0)
{
$upd.=",us.strength=us.strength+{$coud['crSTR']}";
$ev.=", {$coud['crSTR']} strength";
}
if($coud['crGUARD'] > 0)
{
$upd.=",us.guard=us.guard+{$coud['crGUARD']}";
$ev.=", {$coud['crGUARD']} guard";
}
if($coud['crLABOUR'] > 0)
{
$upd.=",us.labour=us.labour+{$coud['crLABOUR']}";
$ev.=", {$coud['crLABOUR']} labour";
}
if($coud['crAGIL'] > 0)
{
$upd.=",us.agility=us.agility+{$coud['crAGIL']}";
$ev.=", {$coud['crAGIL']} agility";
}
if($coud['crIQ'] > 0)
{
$upd.=",us.IQ=us.IQ+{$coud['crIQ']}";
$ev.=", {$coud['crIQ']} IQ";
}
$ev=substr($ev,1);
if ($upd) {
$db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid");
}
$db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')");
}
$db->query("TRUNCATE TABLE votes");
$fo=fopen("jailshouts.txt","w");
fclose($fo);
?>

 

Try that.

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.

 Share

×
×
  • Create New...