Heloes Hive Workshop! I have a problem
Here's my code:
Neverming the code, but what I need is an answer to the question: Why, if I don't add 'call TriggerSleepAction(1)' before 'call KillSoundWhenDoneBJ(pleh)' it doesn't play the sound? It worked before, but I changed the code while not changing the sound function at all and it all broke.
@EDIT: Nevermind now, I fixed it by myself making a function, which creates sound itself and removes it, so I don't have to use Sound Editor for it.
Here's my code:
JASS:
function zaklinacz_efekt takes nothing returns nothing
local integer nr
local sound pleh
if (not (UnitHasBuffBJ(GetEventDamageSource(), 'B00B'))) or (not (UnitHasBuffBJ(GetEventDamageSource(), 'B00C'))) or (not (UnitHasBuffBJ(GetEventDamageSource(), 'B00D'))) then
call DestroyEffect(AddSpecialEffectLocBJ(GetUnitLoc(GetTriggerUnit()), "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl"))
endif
if GetRandomInt(1,2) == 1 then
set pleh = gg_snd_ZB1
else
set pleh = gg_snd_ZB2
endif
call PlaySoundOnUnitBJ(pleh, 100.0, GetEventDamageSource())
if GetUnitAbilityLevel(GetEventDamageSource(), 'A007') > 1 then
set nr = GetPlayerId(GetOwningPlayer(GetEventDamageSource()))
set udg_x[nr] = GetRandomInt(1, 1000)
if udg_x[nr] <= 400 then
call oglusz(jaka_strona(Player(nr)), 2, GetTriggerUnit())
endif
endif
call TriggerSleepAction(1)
call KillSoundWhenDoneBJ(pleh)
set pleh = null
endfunction
Neverming the code, but what I need is an answer to the question: Why, if I don't add 'call TriggerSleepAction(1)' before 'call KillSoundWhenDoneBJ(pleh)' it doesn't play the sound? It worked before, but I changed the code while not changing the sound function at all and it all broke.
@EDIT: Nevermind now, I fixed it by myself making a function, which creates sound itself and removes it, so I don't have to use Sound Editor for it.
Last edited: