|
楼主 |
发表于 2010-11-12 17:18:28
|
显示全部楼层
其实没有死循环,那个即使把时间改成1也会弹出来。
function B takes nothing returns nothing
local location loc
set loc=Location(0,0)
call SaveLocationHandle(udg_HT,0,0,loc)
call RemoveLocation(loc)
set loc=null
endfunction
function A takes nothing returns nothing
local location loc
set loc=Location(0,0)
call SaveLocationHandle(udg_HT,0,0,loc)
call RemoveLocation(loc)
call FlushChildHashtable(udg_HT,0) //************************加多这一句就不会弹出了,我的经验是如果要删除handle类型的数据就一定要把存储handle的表给毁了,顺便问一下在代码上面加什么前缀后缀可以高亮语法。。
set loc=null
//call B() //未出错
call TimerStart(CreateTimer(),1,false,function A)// 弹出
call DisplayTextToPlayer(Player(0),0,0,"aa")
endfunction
//------------------------------------------------------------
function Trig_aa_Actions takes nothing returns nothing
local trigger trig
call DisplayTextToPlayer(Player(0),0,0,"aa")
set trig = CreateTrigger( )
call TriggerRegisterPlayerChatEvent(trig, Player(0), "1", true )
call TriggerAddAction( trig, function A )
set trig = CreateTrigger( )
call TriggerRegisterPlayerChatEvent(trig, Player(0), "2", true )
call TriggerAddAction( trig, function B )
endfunction
//===========================================================================
function InitTrig_aa takes nothing returns nothing
set gg_trg_aa = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_aa, 0.00 )
call TriggerAddAction( gg_trg_aa, function Trig_aa_Actions )
endfunction |
|