View file modules/built/cron/cron_built_gold.asp
<?php include('../../../system/include/settings.inc');//Потключаемся к базе $req = mysql_query("SELECT * FROM `my_construction` WHERE `type` = 'gold'"); while ($cron = mysql_fetch_array($req)) { $req = mysql_query("SELECT * FROM `chars` WHERE `nick` = '".$cron['usr']."'"); $usr = mysql_fetch_array($req); if($cron['usr'] == $usr['nick']) { $gold = $usr['gold'] + $cron['earnings']; mysql_query("UPDATE `chars` SET `gold` = '$gold' WHERE `nick` = '".$cron['usr']."'"); }} ?> ?>