Cron probleem

  • Onderwerp starter Onderwerp starter snor
  • Startdatum Startdatum
Status
Niet open voor verdere reacties.

snor

Gebruiker
Lid geworden
19 okt 2007
Berichten
482
Beste leden.

Mijn _cron_hour.php en _cron_day.php werken niet meer.

Ik heb in de _cron_hour.php en _cron_day.php de dingen voor de clan toegevoegd. En nu werkt de cron (voor een deel) niet meer.

Dit is mijn _cron_hour.php :
Code:
<?php /* ------------------------- */

  if($cron_pass != "secretcronpassword")
    exit;

  mysql_query("UPDATE `[bloodtypes]` SET `bloodaamm`='2000' AND `bloodbamm`='2000' AND `bloodabamm`='2000' AND `bloodoamm`='2000' WHERE `id`='2'");
  mysql_query("UPDATE `[users]` SET `betaal`='1' WHERE `paying`='0'");
  mysql_query("UPDATE `[users]` SET `vermoordtijd`=`vermoordtijd`-1 WHERE `vermoordtijd`>'1'");
  mysql_query("UPDATE `equipment` SET `voorraad`='1000' WHERE `type`='S'");
  mysql_query("UPDATE `bankrekeningen` SET `bank`='100000000' WHERE `bank`>'99999999999999999999999999999999999999999999'");
  mysql_query("UPDATE `[users]` set `klikmissie`='0'");
  mysql_query("UPDATE `[users]` set `BankB`='0'");

  $select = mysql_query("SELECT * FROM `[buildings]` WHERE `type`='bulletfactory' AND `active`>='25'");
   while($aantal = mysql_fetch_object($select)) {
	$pricPhour = ($aantal->active == 50) ? "5000" : "$pricPhour";
	$pricPhour = ($aantal->active == 100) ? "10000" : "$pricPhour";
	$pricPhour = ($aantal->active == 250) ? "12500" : "$pricPhour";
	$pricPhour = ($aantal->active == 500) ? "25000" : "$pricPhour";
	$pricPhour = ($aantal->active == 1000) ? "50000" : "$pricPhour";
	
  mysql_query("UPDATE `[clans]` SET `cash`=`cash`+1000,`bank`=`bank`+200");
	
  $dbres        = mysql_query("SELECT * FROM `[clans]` WHERE `money_lvl1` > 0");
  while($clan = mysql_fetch_object($dbres)) {
    if($clan->type == 1)
      mysql_query("UPDATE `[users]` SET `cash`=`cash`+". (50*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
      mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`+". (150*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");			
    else if($clan->type == 2)
      mysql_query("UPDATE `[users]` SET `cash`=`cash`+". (50*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
      mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`+". (150*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
    else if($clan->type == 3)
      mysql_query("UPDATE `[users]` SET `cash`=`cash`+". (50*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
      mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`+". (150*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
    else if($clan->type == 1)
      mysql_query("UPDATE `[users]` SET `cash`=`cash`+". (50*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
      mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`+". (150*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
    else if($clan->type == 2)
      mysql_query("UPDATE `[users]` SET `cash`=`cash`+". (50*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
      mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`+". (150*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
    else if($clan->type == 3)
      mysql_query("UPDATE `[users]` SET `cash`=`cash`+". (50*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
      mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`+". (150*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
  }	

	$select = mysql_query("SELECT `login` FROM `[users]` WHERE `login`='{$aantal->owner}' AND `cash`<'$pricPhour'");
	  while($teweinig = mysql_fetch_object($select)) {
		mysql_query("UPDATE `[buildings]` SET `active`='0' WHERE `owner`='{$teweinig->login}' AND `type`='bulletfactory'");
	  }
	  if(mysql_num_rows($select) == 0) {
		mysql_query("UPDATE `[buildings]` SET `amount`=`amount`+'$aantal->active' WHERE `type`='bulletfactory' AND `active`>='25'");
		mysql_query("UPDATE `[users]` SET `cash`=`cash`-'$pricPhour' WHERE `login`='{$aantal->owner}'");
		mysql_query("UPDATE `[buildings]` SET `profit`=`profit`-'$pricPhour' WHERE `type`='bulletfactory' AND `active`>='25'");
	  }
   }
/* ------------------------- */ ?>

Dit is mijn _cron_day.php :
Code:
<?php /* ------------------------- */

  if($cron_pass != "secretcronpassword")
    exit;

  mysql_query("UPDATE `[users]` SET `IPs`=''");
  mysql_query("DELETE FROM `[logs]` WHERE `area`='click'");

  mysql_query("UPDATE `[users]` SET `nonactief`=`nonactief`-1 WHERE `dagen`='1'");
  mysql_query("UPDATE `[users]` SET `dagen`='0' WHERE `nonactief`='0'");
  mysql_query("UPDATE `[users]` SET `paying`=`paying`-1 WHERE `betaal`='255'");
  mysql_query("UPDATE `[users]` SET `nederwiet`=`nederwiet`+1 WHERE `nederwiet` < 20");
  mysql_query("UPDATE `[users]` SET `xtc`=`xtc`+1 WHERE `xtc` < 20");
  mysql_query("UPDATE `[users]` SET `lsd`=`lsd`+1 WHERE `lsd` < 20");
  mysql_query("UPDATE `[users]` SET `speed`=`speed`+1 WHERE `speed` < 20");
  mysql_query("UPDATE `[users]` SET `paddo`=`paddo`+1 WHERE `paddo` < 20");
  mysql_query("UPDATE `[users]` SET `opium`=`opium`+1 WHERE `opium` < 20");
  mysql_query("UPDATE `[users]` SET `nederwiet`=`nederwiet`+2 WHERE `paying` > 1 AND `nederwiet` < 40");
  mysql_query("UPDATE `[users]` SET `xtc`=`xtc`+2 WHERE `paying` > 1 AND `xtc` < 40");
  mysql_query("UPDATE `[users]` SET `lsd`=`lsd`+2 WHERE `paying` > 1 AND `lsd` < 40");
  mysql_query("UPDATE `[users]` SET `speed`=`speed`+2 WHERE `paying` > 1 AND `speed` < 40");
  mysql_query("UPDATE `[users]` SET `paddo`=`paddo`+2 WHERE `paying` > 1 AND `paddo` < 40");
  mysql_query("UPDATE `[users]` SET `opium`=`opium`+2 WHERE `paying` > 1 AND `opium` < 40");
  mysql_query("UPDATE `[users]` SET `ocs`='0',`ocsdoen`='2',`clickstoday`='0'");
  mysql_query("UPDATE `[users]` SET `autos1`='0',`autos2`='0',`autos3`='0',`autos4`='0',`autos5`='0',`autos6`='0',`autos7`='0',`autos8`='0',`autos9`='0',`autos10`='0'");

  mysql_query("UPDATE `[users]` SET `cash`=`cash`*1.02 WHERE `betaal`!='255'");
  mysql_query("UPDATE `[users]` SET `cash`=`cash`*1.05 WHERE `betaal`='255'");
  mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`*1.03 WHERE `bank` < 100000000");

  mysql_query("OPTIMIZE TABLE `[logs]`");
  mysql_query("OPTIMIZE TABLE `[temp]`");
  mysql_query("OPTIMIZE TABLE `[users]`");
  mysql_query("OPTIMIZE TABLE `[clans]`");	

  mysql_query("UPDATE `[clans]` SET `IPs`=''");	
  mysql_query("UPDATE `[clans]` SET `bank`=`bank`*1.05,`bankleft`=50,`clickstoday`=0");	
	
  $dbres        = mysql_query("SELECT * FROM `[clans]` WHERE `money_lvl1` > 0");
  while($clan = mysql_fetch_object($dbres)) {
    if($clan->type == 1)
      mysql_query("UPDATE `[users]` SET `cash`=`cash`+". (50*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
      mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`+". (150*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");	
    else if($clan->type == 2)
      mysql_query("UPDATE `[users]` SET `cash`=`cash`+". (50*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
      mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`+". (150*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");	
    else if($clan->type == 3)
      mysql_query("UPDATE `[users]` SET `cash`=`cash`+". (50*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
      mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`+". (150*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");	
    else if($clan->type == 4)
      mysql_query("UPDATE `[users]` SET `cash`=`cash`+". (50*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
      mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`+". (150*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");	
    else if($clan->type == 5)
      mysql_query("UPDATE `[users]` SET `cash`=`cash`+". (50*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
      mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`+". (150*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");	
    else if($clan->type == 6)
      mysql_query("UPDATE `[users]` SET `cash`=`cash`+". (50*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");
      mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`+". (150*$clan->money_lvl1) ." WHERE `clan`='{$clan->name}'");	
  }	

/* ------------------------- */ ?>
 
Misschien iets meer info? Wat werkt er niet meer, krijg je nog errors, wat heb je gewijzigd?
 
Ik krijg geen erro mijn corn werkt gewoon niet meer. Hij wordt niet uitgevoerd.
Dit was mijn _cron_hour.php eerst (toen werkte hij wel) :
Code:
<?php /* ------------------------- */

  if($cron_pass != "secretcronpassword")
    exit;

  mysql_query("UPDATE `[bloodtypes]` SET `bloodaamm`='2000' AND `bloodbamm`='2000' AND `bloodabamm`='2000' AND `bloodoamm`='2000' WHERE `id`='2'");
  mysql_query("UPDATE `[users]` SET `betaal`='1' WHERE `paying`='0'");
  mysql_query("UPDATE `[users]` SET `vermoordtijd`=`vermoordtijd`-1 WHERE `vermoordtijd`>'1'");
  mysql_query("UPDATE `equipment` SET `voorraad`='1000' WHERE `type`='S'");
  mysql_query("UPDATE `bankrekeningen` SET `bank`='100000000' WHERE `bank`>'99999999999999999999999999999999999999999999'");
  mysql_query("UPDATE `[users]` set `klikmissie`='0'");
  mysql_query("UPDATE `[users]` set `BankB`='0'");

  $select = mysql_query("SELECT * FROM `[buildings]` WHERE `type`='bulletfactory' AND `active`>='25'");
   while($aantal = mysql_fetch_object($select)) {
	$pricPhour = ($aantal->active == 50) ? "5000" : "$pricPhour";
	$pricPhour = ($aantal->active == 100) ? "10000" : "$pricPhour";
	$pricPhour = ($aantal->active == 250) ? "12500" : "$pricPhour";
	$pricPhour = ($aantal->active == 500) ? "25000" : "$pricPhour";
	$pricPhour = ($aantal->active == 1000) ? "50000" : "$pricPhour";

	$select = mysql_query("SELECT `login` FROM `[users]` WHERE `login`='{$aantal->owner}' AND `cash`<'$pricPhour'");
	  while($teweinig = mysql_fetch_object($select)) {
		mysql_query("UPDATE `[buildings]` SET `active`='0' WHERE `owner`='{$teweinig->login}' AND `type`='bulletfactory'");
	  }
	  if(mysql_num_rows($select) == 0) {
		mysql_query("UPDATE `[buildings]` SET `amount`=`amount`+'$aantal->active' WHERE `type`='bulletfactory' AND `active`>='25'");
		mysql_query("UPDATE `[users]` SET `cash`=`cash`-'$pricPhour' WHERE `login`='{$aantal->owner}'");
		mysql_query("UPDATE `[buildings]` SET `profit`=`profit`-'$pricPhour' WHERE `type`='bulletfactory' AND `active`>='25'");
	  }
   }
/* ------------------------- */ ?>

Dit was mijn _cron_day.php eerst (toen werkte hij wel) :
Code:
<?php /* ------------------------- */

  if($cron_pass != "secretcronpassword")
    exit;

  mysql_query("UPDATE `[users]` SET `IPs`=''");
  mysql_query("DELETE FROM `[logs]` WHERE `area`='click'");

  mysql_query("UPDATE `[users]` SET `nonactief`=`nonactief`-1 WHERE `dagen`='1'");
  mysql_query("UPDATE `[users]` SET `dagen`='0' WHERE `nonactief`='0'");
  mysql_query("UPDATE `[users]` SET `paying`=`paying`-1 WHERE `betaal`='255'");
  mysql_query("UPDATE `[users]` SET `nederwiet`=`nederwiet`+1 WHERE `nederwiet` < 20");
  mysql_query("UPDATE `[users]` SET `xtc`=`xtc`+1 WHERE `xtc` < 20");
  mysql_query("UPDATE `[users]` SET `lsd`=`lsd`+1 WHERE `lsd` < 20");
  mysql_query("UPDATE `[users]` SET `speed`=`speed`+1 WHERE `speed` < 20");
  mysql_query("UPDATE `[users]` SET `paddo`=`paddo`+1 WHERE `paddo` < 20");
  mysql_query("UPDATE `[users]` SET `opium`=`opium`+1 WHERE `opium` < 20");
  mysql_query("UPDATE `[users]` SET `nederwiet`=`nederwiet`+2 WHERE `paying` > 1 AND `nederwiet` < 40");
  mysql_query("UPDATE `[users]` SET `xtc`=`xtc`+2 WHERE `paying` > 1 AND `xtc` < 40");
  mysql_query("UPDATE `[users]` SET `lsd`=`lsd`+2 WHERE `paying` > 1 AND `lsd` < 40");
  mysql_query("UPDATE `[users]` SET `speed`=`speed`+2 WHERE `paying` > 1 AND `speed` < 40");
  mysql_query("UPDATE `[users]` SET `paddo`=`paddo`+2 WHERE `paying` > 1 AND `paddo` < 40");
  mysql_query("UPDATE `[users]` SET `opium`=`opium`+2 WHERE `paying` > 1 AND `opium` < 40");
  mysql_query("UPDATE `[users]` SET `ocs`='0',`ocsdoen`='2',`clickstoday`='0'");
  mysql_query("UPDATE `[users]` SET `autos1`='0',`autos2`='0',`autos3`='0',`autos4`='0',`autos5`='0',`autos6`='0',`autos7`='0',`autos8`='0',`autos9`='0',`autos10`='0'");

  mysql_query("UPDATE `[users]` SET `cash`=`cash`*1.02 WHERE `betaal`!='255'");
  mysql_query("UPDATE `[users]` SET `cash`=`cash`*1.05 WHERE `betaal`='255'");
  mysql_query("UPDATE `bankrekeningen` SET `bank`=`bank`*1.03 WHERE `bank` < 100000000");

  mysql_query("OPTIMIZE TABLE `[logs]`");
  mysql_query("OPTIMIZE TABLE `[temp]`");
  mysql_query("OPTIMIZE TABLE `[users]`");

/* ------------------------- */ ?>
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan