很抱歉打扰所有忙碌的人,我只是无法弄清楚为什么该功能不起作用。反复试验花了 50 分钟。给出的错误是针对第 15 行“case 'smug': smug_1(); break;”
<?php
include "globals.php";
if ($ir['jailtime'] > 0) {
print "<center>The docks are closed to jail birds come back when thay release you</center>";
exit;
}
if ($ir['hospital'] > 0) {
print "<center>You cant go sailing while in hospital</center>";
exit;
}
switch ($_GET['action']) {
case 'smug':
smug_1();
break;
case 'smugsub':
smug_1_sub();
break;
case 'smug2':
smug_2();
break;
case 'smugsub':
smug_2_sub();
break;
case 'smug3':
smug_3();
break;
case 'smug3sub':
smug_3_sub();
break;
case 'smug4':
smug_4();
break;
case 'smug4sub':
smug_4_sub();
break;
case 'smug5':
smug_5();
break;
case 'smug5sub':
smug_5_sub();
break;
case 'smug6':
smug_6();
break;
case 'smug6sub':
smug_6_sub();
break;
default:
smug_index('action');
break;
}
function smug_index()
{
global $ir, $c, $userid;
print "<center><h3>Crystal Smuggling</h3></center>
<center>You have {$ir['csmuggling']} Smuggling Turns Left.<br />
Welcome to the crystal smuggling docks. You can go to these location, more will be available when you are a higher level:</center>
[<a href='csmuggling.php?action=smug'>> France</a>]";
if ($ir['level'] > 5) {
print "[<a href='csmuggling.php?action=smug2'>> Holland</a>]";
if ($ir['level'] > 10) {
print "[<a href='csmuggling.php?action=smug3'>> Germany</a>]";
if ($ir['level'] > 20) {
print "[<a href='csmuggling.php?action=smug4'>> Portugal</a>]";
if ($ir['level'] > 30) {
print "[<a href='csmuggling.php?action=smug5'>> Spain</a>]";
if ($ir['level'] > 70) {
print "[<a href='csmuggling.php?action=smug6'>> Switzerland</a>]</center>";
}
function smug_1()
{
global $db, $ir, $c, $userid;
$rand_gems = rand(1, 3);
echo "<center>You get over to France And Managed To Smuggle $rand_gems crystals back.</center>";
mysql_query("UPDATE users SET crystals=crystals+$rand_gems WHERE userid=$userid");
mysql_query("UPDATE users SET csmuggling=smuggling-1 WHERE userid=$userid");
print "<center>[<a href='explore.php'>> Back</a>]</center>";
}
function smug_2()
{
global $db, $ir, $c, $userid;
$rand_gems = rand(2, 6);
echo "<center>You get over to Holland And Managed To Smuggle $rand_gems crystals back.</center>
";
mysql_query("UPDATE users SET crystals=crystals+$rand_gems WHERE userid=$userid");
mysql_query("UPDATE users SET csmuggling=smuggling-1 WHERE userid=$userid");
print "<center>[<a href='explore.php'>> Back</a>]</center>";
}
function smug_3()
{
global $db, $ir, $c, $userid;
$rand_gems = rand(4, 9);
echo "<center>You get over to Germany And Managed To Smuggle $rand_gems crystals back.</center>
";
mysql_query("UPDATE users SET crystals=crystals+$rand_gems WHERE userid=$userid");
mysql_query("UPDATE users SET csmuggling=smuggling-1 WHERE userid=$userid");
print "<center>[<a href='explore.php'>> Back</a>]</center>";
}
function smug_4()
{
global $db, $ir, $c, $userid;
$rand_gems = rand(9, 12);
echo "<center>You get over to Portugal And Managed To Smuggle $rand_gems crystals back.</center>
";
mysql_query("UPDATE users SET crystals=crystals+$rand_gems WHERE userid=$userid");
mysql_query("UPDATE users SET csmuggling=smuggling-1 WHERE userid=$userid");
print "<center>[<a href='explore.php'>> Back</a>]</center>";
}
function smug_5()
{
global $db, $ir, $c, $userid;
$rand_gems = rand(11, 15);
print "<center>You get over to Spain And Managed To Smuggle $rand_gems crystals back.</center>
";
mysql_query("UPDATE users SET crystals=crystals+$rand_gems WHERE userid=$userid");
mysql_query("UPDATE users SET csmuggling=smuggling-1 WHERE userid=$userid");
print "<center>[<a href='explore.php'>> Back</a>]</center>";
}
function smug_6()
{
global $db, $ir, $c, $userid;
$rand_gems = rand(13, 17);
echo "<center>You get over to Switzerland And Managed To Smuggle $rand_gems crystals back.</center>
";
mysql_query("UPDATE users SET crystals=crystals+$rand_gems WHERE userid=$userid");
mysql_query("UPDATE users SET csmuggling=smuggling-1 WHERE userid=$userid");
print "<center>[<a href='explore.php'>> Back</a>]</center>";
}
}
}
}
}
}
感谢您花时间帮助我。:)