globals
hashtable hash = InitHashtable()
endglobals
function ExampleSetup takes nothing returns nothing
call SaveInteger( hash, 1 , 1 , 100)
call SaveInteger( hash, 1 , 2 , 75 )
call SaveInteger( hash, 1 , 3 , 50 )
call SaveInteger( hash, 1 , 4 , 25 )
call SaveInteger( hash, 1 , 5 , 0 )
call SaveStr( hash, 2 , 1 , "Hello" )
call SaveStr( hash, 2 , 2 , "Hi" )
call SaveStr( hash, 2 , 3 , "Yo" )
call SaveStr( hash, 2 , 4 , "Hey" )
call SaveStr( hash, 2 , 5 , "Bzzz" )
endfunction
function ExampleActions takes nothing returns nothing
local integer i = GetRandomInt(1,5)
local integer j = GetRandomInt(1, 100)
if j < LoadInteger(hash, 1 , i ) then
call BJDebugMsg( I2S(j) + " < " + I2S(LoadInteger(hash, 1 , i )) )
call BJDebugMsg( LoadStr(hash, 2 , i ) )
call BJDebugMsg( " " )
endif
endfunction
//===========================================================================
function InitTrig_Example takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterPlayerEvent(t, Player(0), EVENT_PLAYER_END_CINEMATIC)
call TriggerAddAction( t, function ExampleActions )
call ExampleSetup()
endfunction