It'd probably need to be precached and it'd need a line in base_jump:ontouch to actually play the sound. But, you're most likely better off using an ambient_generic entity in the map and then making it play the sound with Lua using OutputEvent, though, as BroadCastSound plays the sound universally and doesn't factor in a player's distance from the event itself.
To play an ambient generic from Lua, use:
Code:
OutputEvent( "entity_name", "PlaySound" )
To add this to the trigger code while making it easy to have jump triggers with different sounds, you would do this:
Code:
------------------------------------------
-- jump triggers
------------------------------------------
base_jump = trigger_ff_script:new({ pushx = 0, pushy = 0, pushz = 0, sound_entname="base_jump_sound" })
-- push people when they touch the trigger
function base_jump:ontouch( trigger_entity )
if IsPlayer( trigger_entity ) then
local player = CastToPlayer( trigger_entity )
player:SetVelocity( Vector( self.pushx, self.pushy, self.pushz ) )
OutputEvent( self.sound_entname, "PlaySound" )
end
end
-- up push
jump_up = base_jump:new({ pushx = 0, pushy = 0, pushz = 1000, sound_entname="jump_up_sound" })
jump_up_alt = base_jump:new({ pushx = 0, pushy = 0, pushz = 1000, sound_entname="jump_up_sound2"})