- Joined
- Jul 26, 2008
- Messages
- 1,009
I decided to make a few triggers for a chat trigger help file.
I figured the simplest way to do it is make a trigger array since it needs to be created for all players except one. However it spams the message on the screen, so I assume the trigger is being made more than once for one player.
Any help on why? I can't seem to locate the issue.
I figured the simplest way to do it is make a trigger array since it needs to be created for all players except one. However it spams the message on the screen, so I assume the trigger is being made more than once for one player.
Any help on why? I can't seem to locate the issue.
JASS:
function Init takes nothing returns nothing
local trigger array h
local integer i = 0
loop
set h[i] = CreateTrigger()
set i = i + 1
exitwhen i == 10
endloop
set i = 0
loop
if i != 4 then
call TriggerRegisterPlayerChatEvent( h[0], Player(i), "-help", true )
call TriggerAddAction( h[0], function HelpInfo_Actions )
endif
set i = i + 1
exitwhen i == 11
endloop
set i = 0
loop
if i != 4 then
call TriggerRegisterPlayerChatEvent( h[1], Player(i), "-haven", true )
call TriggerAddAction( h[1], function HavenInfo_Actions )
endif
set i = i + 1
exitwhen i == 11
endloop
set i = 0
loop
if i != 4 then
call TriggerRegisterPlayerChatEvent( h[2], Player(i), "-slayer", true )
call TriggerAddAction( h[2], function SlayerInfo_Actions )
endif
set i = i + 1
exitwhen i == 11
endloop
set i = 0
loop
if i != 4 then
call TriggerRegisterPlayerChatEvent( h[3], Player(i), "-watcher", true )
call TriggerAddAction( h[3], function WatcherInfo_Actions )
endif
set i = i + 1
exitwhen i == 11
endloop
set i = 0
loop
if i != 4 then
call TriggerRegisterPlayerChatEvent( h[4], Player(i), "-units", true )
call TriggerAddAction( h[4], function UnitsInfo_Actions )
endif
set i = i + 1
exitwhen i == 11
endloop
set i = 0
loop
if i != 4 then
call TriggerRegisterPlayerChatEvent( h[5], Player(i), "-goal", true )
call TriggerAddAction( h[5], function GoalInfo_Actions )
endif
set i = i + 1
exitwhen i == 11
endloop
set i = 0
loop
if i != 4 then
call TriggerRegisterPlayerChatEvent( h[6], Player(i), "-temple", true )
call TriggerAddAction( h[6], function TempleInfo_Actions )
endif
set i = i + 1
exitwhen i == 11
endloop
set i = 0
loop
if i != 4 then
call TriggerRegisterPlayerChatEvent( h[7], Player(i), "-quests", true )
call TriggerAddAction( h[7], function QuestsInfo_Actions )
endif
set i = i + 1
exitwhen i == 11
endloop
set i = 0
loop
if i != 4 then
call TriggerRegisterPlayerChatEvent( h[8], Player(i), "-guards", true )
call TriggerAddAction( h[8], function GuardsInfo_Actions )
endif
set i = i + 1
exitwhen i == 11
endloop
set i = 0
loop
if i != 4 then
call TriggerRegisterPlayerChatEvent( h[9], Player(i), "-11th", true )
call TriggerAddAction( h[9], function Info11th_Actions )
endif
set i = i + 1
exitwhen i == 11
endloop
set i = 0
loop
if i != 4 then
call TriggerRegisterPlayerChatEvent( h[10], Player(i), "-hint", true )
call TriggerAddAction( h[10], function HintInfo_Actions )
endif
set i = i + 1
exitwhen i == 11
endloop
set i = 0
loop
set h[i] = null
set i = i + 1
exitwhen i == 10
endloop
endfunction
Last edited: