dracolich
TH.net Regular
- Reaction score
- 15
JASS:
function apem takes nothing returns nothing
local trigger t=GetTriggeringTrigger()
local integer i=GetHandleId(t)
local unit u=LoadUnitHandle(udg_hashtable,i,25)
call RemoveUnit(u)
call DestroyTrigger(GetTriggeringTrigger())
endfunction
function arem takes nothing returns nothing
local unit u=CreateUnit(Player(15),039;hpea039;,0,0,0)
local trigger t=CreateTrigger()
local integer i=GetHandleId(t)
call SaveUnitHandle(udg_hashtable,i,25,u)
call TriggerRegisterTimerEventPeriodic(t,0.2)
call TriggerAddAction(t,function apem)
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
local trigger aga=CreateTrigger()
call TriggerRegisterPlayerChatEvent( aga, Player(0), "-s", true )
call TriggerAddAction( aga, function arem )
endfunction
globals
trigger InitTrig_Untitled_Trigger_001=null
hashtable udg_hashtable
endglobals
Should be: after typing, create unit for 0.2 sec, then delete him. Since I dont know, how many times it will be written, i should use hashtable, right?
But (LoadUnitHandle(udg_hashtable,i,25)) return nothing instead unit. Syntax checker said that here OK, and it should, but still - doesnt work on this line.
What I did wrong?