function Trig_example_Actions takes nothing returns nothing
local real x = GetLocationX(udg_leakpoint[1])
local real y = GetLocationY(udg_leakpoint[1])
local unit u
set u = CreateUnit(GetPlayerId(Player(1)), 'unitid', x,y, bj_UNIT_FACING)
call RemoveLocation(udg_leakpoint[1])
set u = null
call DestroyTrigger(GetTriggeringTrigger()) // if your trigger have single-use type
endfunction
//=============
function InitTrig_example takes nothing returns nothing
set gg_trg_example = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_example, Player(0), "test", true )
call TriggerAddAction( gg_trg_example, function Trig_example_Actions )
endfunction
OR // if your trigger not have single-use type, I make so, maybe its true=)
function InitTrig_example takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerChatEvent(t, Player(0), "test", true)
call TriggerAddAction(t, function Trig_example_Actions)
set t = null
endfunction