hi everyone,
is this trigger safe?
[Jass=]
function Trig_Building_ProgressBar takes nothing returns nothing
local texttag udg_LocalText
local unit building
local real visible
local integer A
set udg_LocalPlayer = GetTriggerPlayer()
set building = GetConstructingStructure()
if ( IsPlayerInForce(udg_LocalPlayer, udg_Team[1]) == true )
set A = 1
elseif ( IsPlayerInForce(udg_LocalPlayer, udg_Team[2]) == true )
set A = 2
elseif ( IsPlayerInForce(udg_LocalPlayer, udg_Team[3]) == true )
set A = 3
else
set A = 4
endif
if ( GetUnitTypeId(building) == 'h016' ) then
if ( IsPlayerInForce(GetLocalPlayer(), udg_Team[A]) == true ) then
set visible = 0
else
set visible = 100
endif
call CreateTextTagUnitBJ( udg_ProgressBar[7], GetConstructingStructure(), 0, 8.00, 100, 100, 100, visible )
set udg_LocalText = GetLastCreatedTextTag()
call PolledWait( 0.50 )
if ( IsUnitAliveBJ(building) == true ) then
call SetTextTagTextBJ( udg_LocalText, udg_ProgressBar[8], 8.00 )
else
call DestroyTextTagBJ( udg_LocalText )
return
endif
call PolledWait( 0.50 )
call DestroyTextTagBJ( udg_LocalText )
endif
endfunction
//===========================================================================
function InitTrig_Building_ProgressBar_Copy takes nothing returns nothing
set gg_trg_Building_ProgressBar_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Building_ProgressBar_Copy, EVENT_PLAYER_UNIT_CONSTRUCT_START )
call TriggerAddAction( gg_trg_Building_ProgressBar_Copy, function Trig_Building_ProgressBar )
endfunction[/code]
i need the texttag to show only for team mate of player constructing the structure
is this trigger safe?
[Jass=]
function Trig_Building_ProgressBar takes nothing returns nothing
local texttag udg_LocalText
local unit building
local real visible
local integer A
set udg_LocalPlayer = GetTriggerPlayer()
set building = GetConstructingStructure()
if ( IsPlayerInForce(udg_LocalPlayer, udg_Team[1]) == true )
set A = 1
elseif ( IsPlayerInForce(udg_LocalPlayer, udg_Team[2]) == true )
set A = 2
elseif ( IsPlayerInForce(udg_LocalPlayer, udg_Team[3]) == true )
set A = 3
else
set A = 4
endif
if ( GetUnitTypeId(building) == 'h016' ) then
if ( IsPlayerInForce(GetLocalPlayer(), udg_Team[A]) == true ) then
set visible = 0
else
set visible = 100
endif
call CreateTextTagUnitBJ( udg_ProgressBar[7], GetConstructingStructure(), 0, 8.00, 100, 100, 100, visible )
set udg_LocalText = GetLastCreatedTextTag()
call PolledWait( 0.50 )
if ( IsUnitAliveBJ(building) == true ) then
call SetTextTagTextBJ( udg_LocalText, udg_ProgressBar[8], 8.00 )
else
call DestroyTextTagBJ( udg_LocalText )
return
endif
call PolledWait( 0.50 )
call DestroyTextTagBJ( udg_LocalText )
endif
endfunction
//===========================================================================
function InitTrig_Building_ProgressBar_Copy takes nothing returns nothing
set gg_trg_Building_ProgressBar_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Building_ProgressBar_Copy, EVENT_PLAYER_UNIT_CONSTRUCT_START )
call TriggerAddAction( gg_trg_Building_ProgressBar_Copy, function Trig_Building_ProgressBar )
endfunction[/code]
i need the texttag to show only for team mate of player constructing the structure