|
发表于 2009-3-19 16:37:07
|
显示全部楼层
function Clock takes nothing returns nothing
local multiboarditem mi = MultiboardGetItem(udg_Board,udg_PlayerNum,1)
local string s = null
set udg_TimeS = udg_TimeS + 1
if udg_TimeS >= 60 then
set udg_TimeS = 0
set udg_TimeM = udg_TimeM + 1
endif
if udg_TimeM >= 60 then
set udg_TimeM = 0
set udg_TimeH = udg_TimeH + 1
endif
if udg_TimeH <= 9 then
set s = I2S(0)+I2S(udg_TimeH)+":"
else
set s = I2S(udg_TimeH)+":"
endif
if udg_TimeM <= 9 then
set s = s + I2S(0)+I2S(udg_TimeM)+":"
else
set s = s + I2S(udg_TimeM)+":"
endif
if udg_TimeS <= 9 then
set s = s + I2S(0)+I2S(udg_TimeS)
else
set s = s + I2S(udg_TimeS)
endif
call MultiboardSetItemValue(mi,s)
call MultiboardReleaseItem(mi)
set mi = null
endfunction
PlayerNum+1行2列显示时间
TimeS,TimeM,TimeH为全局变量分别记录秒分时
Timer1秒循环开启这个函数 |
|