--------------------------------------ui.lua
--每1fps时
function UI.Event:OnUpdate (time)
--发出Signal(8964)去game
UI.Signal(8964)
end
--------------------------------------game.lua
--自杀时间(秒)
KILL_TIME=15
--当连接时
function Game.Rule:OnPlayerConnect (player)
--timer变数=现在的时间+自杀时间
player.user.timer=Game.GetTime()+KILL_TIME
end
--当接到Signal时
function Game.Rule:OnPlayerSignal (player, signal)
--如果timer变数大于现在的时间
if player.user.timer > Game.GetTime() then
--自杀
player:Kill()
end
end