- Joined
- Jun 10, 2008
- Messages
- 1,399
Pretty much self explanatory, who don't sounds work the first time?
thanks.
thanks.
function Trig_SoundOrder_Actions takes nothing returns nothing
local integer random = GetRandomInt(0, 2)
local sound Sound
if GetUnitTypeId(GetTriggerUnit()) == 'heng' then
if random == 0 then
set Sound = gg_snd_EngineerYes1
elseif random == 1 then
set Sound = gg_snd_EngineerYes2
else
set Sound = gg_snd_EngineerYes3
endif
endif
if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
call StartSound(Sound)
endif
call SetSoundPosition(Sound, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFlyHeight(GetTriggerUnit()))
set Sound = null
endfunction
//===========================================================================
function InitTrig_SoundOrder takes nothing returns nothing
set gg_trg_SoundOrder = CreateTrigger( )
call TriggerAddAction( gg_trg_SoundOrder, function Trig_SoundOrder_Actions )
call TriggerRegisterPlayerUnitEvent(gg_trg_SoundOrder, GetLocalPlayer(), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER, NullBoolexpr())
endfunction