..........
function printRow ($type)
{
global $users, $uera, $canbuild;
?>
<tr><td><?=$uera[$type]?></td>
<td class="aright"><?=commas($users[$type])?></td>
<td class="aright"><?=commas($canbuild)?></td>
<td class="aright"><input type="text" name="build[<?=$type?>]" size="5" value="0"></td></tr>
<?
}
function getBuildAmounts ()
{
global $users, $config, $urace, $buildcost, $buildrate, $canbuild;
$buildcost = round($config[buildings] + ($users[land] * 0.1));
$buildrate = $users[land] * 0.015 + 4;
$buildrate = round($urace[bpt] * $buildrate);
$canbuild = floor($users[cash] / $buildcost);
if ($canbuild > $buildrate * $users[turns])
$canbuild = $buildrate * $users[turns];
if ($canbuild > $users[freeland])
$canbuild = $users[freeland] / 2;
}
function buildStructures ($type, $cost)
{
global $users, $build, $totalbuild, $totalspent;
$amount = $build[$type];
fixInputNum($amount);
if ($amount < 0)
TheEnd("Не можеш да строиш с отрицателно число!");
$users[$type] += $amount;
$totalbuild += $amount;
$users[freeland] -= $amount;
$users[cash] -= $amount * $cost;
$totalspent += $amount * $cost;
}
getBuildAmounts();
if ($do_build)
{
............
Въпроса ми е как ще стане с това $do_build = $_POST['do_build']; пробрах какво ли не ($build[labs] = $_POST['build[labs']
,но не става.Мерси предварително.
function printRow ($type)
{
global $users, $uera, $canbuild;
?>
<tr><td><?=$uera[$type]?></td>
<td class="aright"><?=commas($users[$type])?></td>
<td class="aright"><?=commas($canbuild)?></td>
<td class="aright"><input type="text" name="build[<?=$type?>]" size="5" value="0"></td></tr>
<?
}
function getBuildAmounts ()
{
global $users, $config, $urace, $buildcost, $buildrate, $canbuild;
$buildcost = round($config[buildings] + ($users[land] * 0.1));
$buildrate = $users[land] * 0.015 + 4;
$buildrate = round($urace[bpt] * $buildrate);
$canbuild = floor($users[cash] / $buildcost);
if ($canbuild > $buildrate * $users[turns])
$canbuild = $buildrate * $users[turns];
if ($canbuild > $users[freeland])
$canbuild = $users[freeland] / 2;
}
function buildStructures ($type, $cost)
{
global $users, $build, $totalbuild, $totalspent;
$amount = $build[$type];
fixInputNum($amount);
if ($amount < 0)
TheEnd("Не можеш да строиш с отрицателно число!");
$users[$type] += $amount;
$totalbuild += $amount;
$users[freeland] -= $amount;
$users[cash] -= $amount * $cost;
$totalspent += $amount * $cost;
}
getBuildAmounts();
if ($do_build)
{
............
Въпроса ми е как ще стане с това $do_build = $_POST['do_build']; пробрах какво ли не ($build[labs] = $_POST['build[labs']