1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Ambient Radio Sounds

Discussion in 'Discussion' started by 003390501570513, Jan 4, 2013.

  1. How would I add ambient radio sounds, so that units in the Civil Protection would broadcast Overwatch radio updates from their mask? Just want to add realism and similarity to the officers in Half-Life 2.

    Maybe also an option to enable/disable radio ambience.
     
  2. PHP:
    for kv in ipairs_player.GetAll() ) do
                if (
    self:PlayerIsCombine(v)) then
                    v
    :EmitSound("soundpath");
                
    end;
            
    end;
    I made something for this. Will post it soon.
     
  3. o_O can't wait to see :D
     
  4. RJ

    RJ no pay Legend Clockwork Customer

    A repeating timer would also be useful for this, or better yet, make it so when a config setting is enabled/disabled.
     
  5. Could someone make this a plugin if possible? I've been requesting this feature for a VERY long time. Thanks for replying.
     
  6. Will make it a fully fledged plugin soon.

    PHP:
    function beep(player)
        for 
    kv in ipairs_player.GetAll() ) do
                
    timer.Simple(1.5, function()
                
    local chance math.random(120)
                
    local chance2 math.random(15)
                for 
    kv in ipairs_player.GetAll() ) do
                    if (
    self:PlayerIsCombine(v) and chance == 1then
                        
    if (chance2 1then
                            v
    :EmitSound("npc/combine_soldier/vo/prison_soldier_prosecuteD7");
                        elseif (
    chance2 2then
                            v
    :EmitSound("npc/combine_soldier/vo/prison_soldier_tohighpoints.wav");
                        elseif (
    chance2 3then
                            v
    :EmitSound("npc/combine_soldier/vo/prison_soldier_leader9dead.wav");
                        elseif (
    chance2 4then
                            v
    :EmitSound("npc/combine_soldier/vo/prison_soldier_negativecontainment.wav");
                        elseif (
    chance2 5then
                            v
    :EmitSound("npc/combine_soldier/vo/prison_soldier_sundown3dead.wav");
                        
    end;--End chance
                    end
    ;--End combine
                end
    ;--End for
            
    end);--End timer
        end
    ;--End for
    end;--End function
     
  7. Is it possible to make some basic radio sounds on there, like "10-4" and "Copy that" as if multiple units are responding to each other?
     
  8. Excellent work, I appreciate the response and release. The plugin would be nice to have indeed, though a few suggestions for the plugin:

    1. Dispatch radio-voice emits instead of another units' (makes it more tied with the canon)
    2. The ability for a single player to turn off the automated responses via a chat command (though I still understand that the plugin can easily be disabled)
     
  9. I made a small mistake in that post. People who know Lua here, don't bash me for accidentally putting 2 for k, v in ipairs.

    And okay 0033.
     
  10. Razor

    Razor Guest

    Code:
    function beep(player)
    	for k, v in ipairs( _player.GetAll() ) do
    			timer.Simple(1.5, function()
    			local chance = math.random(1, 20)
    			local chance2 = math.random(1, 5)
    			for k, v in ipairs( _player.GetAll() ) do
    				if (self:PlayerIsCombine(v) and chance == 1) then
    					if (chance2 = 1) then
    						v:EmitSound("npc/combine_soldier/vo/prison_soldier_prosecuteD7");
    					elseif (chance2 = 2) then
    						v:EmitSound("npc/combine_soldier/vo/prison_soldier_tohighpoints.wav");
    					elseif (chance2 = 3) then
    						v:EmitSound("npc/combine_soldier/vo/prison_soldier_leader9dead.wav");
    					elseif (chance2 = 4) then
    						v:EmitSound("npc/combine_soldier/vo/prison_soldier_negativecontainment.wav");
    					elseif (chance2 = 5) then
    						v:EmitSound("npc/combine_soldier/vo/prison_soldier_sundown3dead.wav");
    					end;--End chance
    				end;--End combine
    			end;--End for
    		end);--End timer
    	end;--End for
    end;--End function
    Code:
    function beep(player)
    	local chance = math.random(1, 20)
    	local sounds = {"npc/combine_soldier/vo/prison_soldier_prosecuteD7",
    	"npc/combine_soldier/vo/prison_soldier_tohighpoints.wav",
    	"npc/combine_soldier/vo/prison_soldier_leader9dead.wav",
    	"npc/combine_soldier/vo/prison_soldier_negativecontainment.wav",
    	"npc/combine_soldier/vo/prison_soldier_sundown3dead.wav"}
    	for k, v in ipairs( _player.GetAll() ) do
    		timer.Simple(1.5, function()
    			if (self:PlayerIsCombine(v) and chance == 1) then
    				v:EmitSound(table.Random(sounds)]);
    			end;--End combine
    		end);--End timer
    	end;--End for
    end;--End function
     
  11. Code:
    function beep(player)
    	local chance = math.random(1, 20)
    	local sounds = {"npc/combine_soldier/vo/prison_soldier_prosecuteD7",
    	"npc/combine_soldier/vo/prison_soldier_tohighpoints.wav",
    	"npc/combine_soldier/vo/prison_soldier_leader9dead.wav",
    	"npc/combine_soldier/vo/prison_soldier_negativecontainment.wav",
    	"npc/combine_soldier/vo/prison_soldier_sundown3dead.wav"}
    	for k, v in ipairs( _player.GetAll() ) do
    		timer.Simple(1.5, function()
    			if (self:PlayerIsCombine(v) and chance == 1) then
    				v:EmitSound(table.Random(sounds)]);
    			end;--End combine
    		end);--End timer
    	end;--End for
    end;--End function
    Where do I put this code?
     
  12. Teegee

    Teegee PM me for help, I'm always willing to lend a

    Could you possibly do one for other factions also, would use this. Good work.
     
  13. Code:
    [ERROR] lua/autorun/ambientradio.lua:14: ')' expected near ']'
      1. unknown - lua/autorun/ambientradio.lua:0
     
  14. Don't use the one I posted here.

    It was badly made and I'm just going to revamp it.
     
  15. Razor

    Razor Guest

    If you remove the ], it is likely it will work.
     
  16. Also need to replace "self" with "Schema".
     
  17. And In what file must you put it?
     
  18. Razor

    Razor Guest

    I recommend putting it into a plugin, otherwise you can put it in sv_hooks, inside the schema, into the PlayerThink function, making sure this code is ran everytime with a certain delay. Or, you put it into PlayerCharacterLoaded, and make it start a timer.
    And into PlayerCharacterUnloaded, you kill that timer.
     
  19. I put it in my plugin sv_hooks.lua:

    Code:
    local PLUGIN = PLUGIN;
    
    function PLUGIN:PlayerThink(player, curTime, infoTable)
    	local chance = math.random(1, 20)
    	local sounds = {"npc/combine_soldier/vo/prison_soldier_prosecuteD7",
    	"npc/combine_soldier/vo/prison_soldier_tohighpoints.wav",
    	"npc/combine_soldier/vo/prison_soldier_leader9dead.wav",
    	"npc/combine_soldier/vo/prison_soldier_negativecontainment.wav",
    	"npc/combine_soldier/vo/prison_soldier_sundown3dead.wav"}
    	for k, v in ipairs( _player.GetAll() ) do
    		timer.Simple(1.5, function()
    			if (Schema:PlayerIsCombine(v) and chance == 1) then
    				v:EmitSound(table.Random(sounds));
    			end;--End combine
    		end);--End timer
    	end;--End for
    end;
    But it doesn't work. What did I do bad?

    Thanks
     
  20. Just don't use this. It shouldn't be in PlayerThink anyways.
     

Previous Readers (Total: 0)