|
发表于 2011-9-3 10:15:08
|
显示全部楼层
[jass]
globals
integer I=0
endglobals //如果编辑器不支持这个请在变量管理器里面创建~
function A takes nothing returns nothing
call DisplayTextToPlayer( Player(0) , 0 , 0 , I2S(I) )
endfunction
function B takes integer i returns nothing
set I=i
call TimerStart( CreateTimer() , 1.00 , true , function A )
endfunction[/jass]
全局变量~
[jass]
globals
gamecache gc=InitGameCache("⑨")
endglobals
function H2I takes handle h returns integer
return h
return 0
endfunction
function A takes nothing returns nothing
call DisplayTextToPlayer( Player(0) , 0 , 0 , I2S(GetStoredInteger(gc, I2S(H2I(GetExpiredTimer())), "value") ))
endfunction
function B takes integer i returns nothing
local timer t=CreateTimer()
call StoreInteger( gc, I2S(H2I(t)), "value", i )
call TimerStart( t , 1.00 , true , function A )
set t=null
endfunction[/jass]
缓存~
[jass] globals
hashtable ht=InitHashtable()
endglobals
function A takes nothing returns nothing
call DisplayTextToPlayer( Player(0) , 0 , 0 , I2S(LoadInteger(ht,GetHandleId(GetExpiredTimer()),0)) )
endfunction
function B takes integer i returns nothing
local timer t=CreateTimer()
call SaveInteger(ht, GetHandleId(t), 0, i);
call TimerStart( t , 1.00 , true , function A )
set t=null
endfunction[/jass]
哈希表~
唔.....手写的米有检查过对错,仅供参考的说~ |
|