hmmm 发表于 2015-4-1 09:49:17

被TimerStart莫名其妙的bug给弄哭了····

本帖最后由 hmmm 于 2015-4-1 09:57 编辑

function DemoTimer takes nothing returns nothing
    call PingMinimap( 0, 0, 1 )
    call DisplayTimedTextToForce( bj_FORCE_ALL_PLAYERS, 30, GetPlayerName(Player(1)) )
endfunction

function DemoOrderAction takes nothing returns nothing
    call DisplayTimedTextToForce( bj_FORCE_ALL_PLAYERS, 30, GetPlayerName(GetTriggerPlayer()) )
    call TimerStart(udg_DemoTimer1,0.2,true,function DemoTimer)
    call DisplayTimedTextToForce( bj_FORCE_ALL_PLAYERS, 30, GetPlayerName(Player(0)) )
endfunction

下面这个函数的三个DisplayTimedTextToForce都可以正常作用,但是DemoTimer里的PingMinimap和DemoTimer真是怎么也没作用
哭QAQ
新建一张地图这样试了下完全没问题,为什么在老地图里就是不行啊。。。

ck5524210 发表于 2015-4-1 12:06:58

计时器新建了?

hmmm 发表于 2015-4-1 13:25:46

ck5524210 发表于 2015-4-1 12:06
计时器新建了?

全局变量的计时器也要新建?

chyj4747 发表于 2015-4-3 23:14:00

hmmm 发表于 2015-4-1 13:25
全局变量的计时器也要新建?

沙发的意思是udg_DemoTimer1在别的地方被删除了或者怎么了,于是导致这里的TimerStart无效了

RoyalFlare 发表于 2015-4-4 13:19:16

udg_DemoTimer1 好逗 在Jass里竟然出现1个全局变量的计时器 你让我说什麽好?

o拼了命去爱你o 发表于 2016-10-10 20:50:33

本帖最后由 o拼了命去爱你o 于 2016-10-10 20:52 编辑

function DemoTimer takes nothing returns nothing
    call PingMinimap( 0, 0, 1 )
    call DisplayTimedTextToForce( bj_FORCE_ALL_PLAYERS, 30, GetPlayerName(Player(1)) )
    call DestroyTimer( GetExpiredTimer() )//销毁计时器
endfunction

function DemoOrderAction takes nothing returns nothing
   
    local timer t = CreateTimer()
    call DisplayTimedTextToForce( bj_FORCE_ALL_PLAYERS, 30, GetPlayerName(GetTriggerPlayer()) )
    call TimerStart(t,0.2,true,function DemoTimer)
    call DisplayTimedTextToForce( bj_FORCE_ALL_PLAYERS, 30, GetPlayerName(Player(0)) )
    set t = null
endfunction
页: [1]
查看完整版本: 被TimerStart莫名其妙的bug给弄哭了····