所以做了一些調整, 如下:
代碼: 選擇全部
#
#-----[ OPEN ]-----
#
rpg/five.php
#
#----[ FIND ]-----
#
$five_result = "<span class=gen>您還需要".$time3."秒才可以繼續!</span><br />";
#
#-----[ REPLACE WITH ]-----
#
$five_result = "您還需要 ".$time3." 秒, 才可以繼續!";
#
#----[ FIND ]-----
#
$five_result = "<span class=gen>恭喜您贏得了獎金".$money."</span></br>";
#
#-----[ REPLACE WITH ]-----
#
$five_result = "經過努力, 恭喜您贏得了獎金 ".$money."";
#
#-----[ SAVE & CLOSE ]-----
#
但是, 經過反覆多次測試後, 發現並非如此.
事實上," 按一次 reload" 只是相當於" 以同樣的下注金額, 擲骰子一次".
可能是前幾次運氣好, 連續贏錢, 所以一直累加,
才會以為有" reload 重複累計獎金" 的問題;
後面幾次的測試, 也就沒有那麼幸運了,
也就是說, " 按一次 reload" 反而會被扣錢(下注金額).
但是如果您是要避免系統負荷過大,
而想要限制玩家擲骰子遊戲的時間間隔的話,
那麼您還是可以參考 五子棋 的修改, 如下:
代碼: 選擇全部
#
#-----[ SQL ]-----
# 已經執行過的話, 就省略這個步驟.
ALTER TABLE phpbb_users ADD fivetime INT (11) DEFAULT "0" NOT NULL
#
#-----[ OPEN ]-----
#
rpg/dice.php
#
#----[ FIND ]-----
#
if ($HTTP_POST_VARS['act']=="bet")
{
#
#-----[ BEFFORE, ADD ]-----
# $fivetime 的值, 請自行酌于增減.
$fivetime = 200;
#
#-----[ AFTER, ADD ]-----
#
$sql="select * from phpbb_users where user_id='".$profiledata[user_id]."'";
$records=$db->sql_query($sql);
$row=$db->sql_fetchrow($records);
$time=time();
$time2=$time-$row[fivetime];
if($time2<$fivetime)
{
$time3=$fivetime-$time2;
$dice_result = "您還需要 ".$time3." 秒, 才可以繼續!";
}
else
{
$fivetime=time();
#
#----[ FIND ]-----
# 這段代碼我有修正過, 請以關鍵字搜尋.
$sql= "UPDATE phpbb_users SET user_money=user_money+".$mony."+".$mony1." WHERE user_id='".$profiledata[user_id]."'";
#
#-----[ REPLACE WITH ]-----
#
$sql= "UPDATE phpbb_users SET user_money=user_money+".$mony."+".$mony1.", fivetime='$fivetime' WHERE user_id='".$profiledata[user_id]."'";
#
#----[ FIND ]-----
# 這段代碼我有修正過, 請以關鍵字搜尋.
$rpg_dice_result .="<table width=\"450\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"
."<tr align=\"center\">"
."<td width=\"65\"><img src=\"images/dice/run.gif\" width=\"38\" height=\"36\" name=\"run1\"></td>"
."<td width=\"68\"><img src=\"images/dice/run.gif\" width=\"38\" height=\"36\" name=\"run2\"></td>"
."<td width=\"71\"><img src=\"images/dice/run.gif\" width=\"38\" height=\"36\" name=\"run3\"></td>"
."<td width=\"218\"><a href=\"#\"><img src=\"images/dice/button.gif\" width=\"50\" height=\"40\" onClick=\"MM_swapImage('run1','','images/dice/".$randid1.".gif',1);MM_swapImage('run2','','images/dice/".$randid2.".gif',1);MM_swapImage('run3','','images/dice/".$randid3.".gif',1);MM_showHideLayers('Layer_result','','show')\" border=\"0\" align=\"absmiddle\"></a>"
."<span class=gen> <-- 下注後, 按下這裡開始!!</span></td>"
."</tr>"
."</table></body>";
#
#-----[ AFTER, ADD ]-----
#
}
#
#----[ FIND ]-----
#
'RPG_DICE_RESULT' => $rpg_dice_result,
#
#-----[ AFTER, ADD ]-----
#
'DICE_RESULT' => $dice_result,
#
#-----[ OPEN ]-----
#
templates/YOUR_THEME/rpg_dice.tpl
#
#-----[ FIND ]-----
#
<tr>
<td colspan="2" align="center" valign="top" nowrap="nowrap"><br /><br /><br />
<span class="gen"><font color="red">{RPG_DICE_RESULT}</font></span></td>
</tr>
</table>
#
#-----[ AFTER, ADD ]-----
#
<p align="center"><font color="#ff6633"><b>{DICE_RESULT}</b></font></p>
#
#-----[ SAVE & CLOSE ]-----
#
