Code:
struct test
integer array Con[10]
static method create takes nothing returns thistype
local thistype this = thistype.allocate()
return this
endmethod
endstruct
Code:
function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
test(1).Con[1]
call DisplayTextToForce( GetPlayersAll(), I2S((test(1).Con[1])) )
call DisplayTextToForce( GetPlayersAll(), I2S((test(2).Con[1])) )
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_002 takes nothing returns nothing
set gg_trg_Untitled_Trigger_002 = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Untitled_Trigger_002, Player(0), "o", true )
call TriggerAddAction( gg_trg_Untitled_Trigger_002, function Trig_Untitled_Trigger_002_Actions )
endfunction
Then i change (test(1).Con[1] = 1), somehow test(2).Con[1] become also 1. Maybe some one could help me with this problem or give me example how to create struct with array.
Last edited: