Raised This Month: $51 Target: $400
 12% 

Background Sounds


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-05-2011 , 01:05   Background Sounds
Reply With Quote #1

Background Sounds

By: nikhilgupta345

Description:
This plugin enables you to play map-specific or general background music on your server during the round. It will start playing at the beginning of the round, and stop at when the round ends.

This plugin supports both .mp3 and .wav file, and also prevents the server from crashing if the sound files do not exist. A message will be logged about which file is missing, so you can easily find out which file needs to be uploaded.

Installation:
    • Click 'Get Plugin' link below
    • Place 'background_sounds.amxx' in addons/amxmodx/plugins/ folder
    • Open addons/amxmodx/configs/plugins.ini and add the line 'background_sounds.amxx' at the bottom
    • If you wish to have specific sounds play on a certain map, create a new folder called sounds in your configs folder. (addons/amxmodx/configs/sounds), and then create a new ini file with the mapname. (Ex. de_dust2.ini)

      DO NOT INCLUDE THE SOUND DIRECTORY IN THE FILE NAME

      Example file
      de_dust2.ini
      Code:
      my_sound1.mp3
      my_sound2.mp3
      my_sound3.wav
    • If you are using the default sounds from below, click on 'resources.zip' from below and extract it to your cstrike folder.
    • Restart server or change map

Cvars:
    • ba_ambience <0/1> <default:1> - Turns plugin on or off
    • ba_sound_change <any number greater than 1> <default:1> - how often a new sound is chosen to be played

Changelog:

Code:
September 05, 2011 - v1.0 -    Initial release
September 06, 2011 - v1.0.1 -  Fixed bug with death sounds not playing at the end of the round

Credits:


Attached Files
File Type: zip resources.zip (1.41 MB, 3479 views)
File Type: sma Get Plugin or Get Source (background_sounds.sma - 4553 views - 6.0 KB)
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please

Last edited by nikhilgupta345; 10-06-2011 at 22:16.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-05-2011 , 01:13   Re: Background Sounds
Reply With Quote #2

precache_sound native and spk command only work without "sound/" in the path, you mustn't include it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
r0ck
Senior Member
Join Date: Jun 2011
Location: India
Old 09-05-2011 , 01:29   Re: Background Sounds
Reply With Quote #3

or use precache_generic
__________________
Preparing to release my plugins..
r0ck is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-05-2011 , 01:30   Re: Background Sounds
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
precache_sound native and spk command only work without "sound/" in the path, you mustn't include it.
For the precache_sound, I'm not precaching with the sound directory in the path, but I see that I am using it in the spk. Uploading fix.

EDIT: Uploaded.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-05-2011 , 02:10   Re: Background Sounds
Reply With Quote #5

PHP Code:
        new szPath256 ];
        
formatexszPathcharsmaxszPath ), "sound/%s"szBuffer );
        
        
client_cmd0"spk ^"%s^""szPath ); 
I'm still seeing that.
Also, maybe you should use "speak" instead of "spk", then you don't need to send stopsound (will stop all sound that's bad).
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-05-2011 , 02:36   Re: Background Sounds
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
PHP Code:
        new szPath256 ];
        
formatexszPathcharsmaxszPath ), "sound/%s"szBuffer );
        
        
client_cmd0"spk ^"%s^""szPath ); 
I'm still seeing that.
Also, maybe you should use "speak" instead of "spk", then you don't need to send stopsound (will stop all sound that's bad).
Oops, uploaded the wrong file.

Anyway, what exactly is difference between speak and spk? How will it know when to stop (on round end)?
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-05-2011 , 04:19   Re: Background Sounds
Reply With Quote #7

You may also be interested by this message : http://wiki.amxmodx.org/Half-Life_1_...AWNSTATICSOUND
__________________
Arkshine is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-05-2011 , 09:41   Re: Background Sounds
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
You may also be interested by this message : http://wiki.amxmodx.org/Half-Life_1_...AWNSTATICSOUND
Would it automatically loop the sound?

Also, does it support both sound formats?

And that type of thing seems like if I set it from an entity, then it becomes like emit_sound, the farther away you are from the start origin or the entity, the softer the sound is.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
vaan123
Veteran Member
Join Date: Sep 2009
Location: Kuwait
Old 09-06-2011 , 22:33   Re: Background Sounds
Reply With Quote #9

bug: death sounds are blocked at the end of every round.
__________________

vaan123 is offline
Send a message via MSN to vaan123 Send a message via Yahoo to vaan123 Send a message via Skype™ to vaan123
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-06-2011 , 22:44   Re: Background Sounds
Reply With Quote #10

Quote:
Originally Posted by vaan123 View Post
bug: death sounds are blocked at the end of every round.
Try now.

Updated to v1.0.1
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:06.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode