AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   quake sounds [Revamped] (Version 2.7.5 / Updated July 18, 2009) (https://forums.alliedmods.net/showthread.php?t=91385)

Grrrrrrrrrrrrrrrrrrr 04-30-2009 16:18

quake sounds [Revamped] (Version 2.7.5 / Updated July 18, 2009)
 
9 Attachment(s)
Quake Sounds [Revamped]
Version: 2.7.5
Old Name: Quake Sounds

Description
The plugin plays sounds and displays text at certain events sometimes based on the number of kills. It currently includes by default two separate sound sets from Quake, a male set and a female set. The sounds and events can be configured.


Changes From the Original
  • Added: client preferences (AKA: cookies or clientprefs)
  • Removed: keyvalues for client settings
  • Fixed bugs & optimized (The original does not work properly)
  • Changed: how quakesoundslist.cfg is read and configured
  • Changed: how plugin.quakesounds.txt is configured
  • Added: DOD head shot support
  • Added: Client preferences menu support (!settings)


Supported Games:

  • Counter Strike:Source
  • Day of Defeat:Source
  • Half Life 2: Deathmatch
  • Team Fortress 2
  • others are unsupported, but you may try this plugin using the "_other.sp" version

Limitations and How to Change Them:
  • Number of Sets (default 5): in quakesounds.sp change #define MAX_NUM_SETS 5
  • Number of sound files (default 102): in quakesounds.sp change #define MAX_NUM_FILES 102


Installation
  1. Pick one of the attached .sp files based on the game your server runs.
    quakesounds_css.sp
    quakesounds_dods.sp
    quakesounds_hl2dm.sp
    quakesounds_tf2.sp
  2. put sm_quakesounds.cfg in cstrike/cfg/sourcemod
  3. extract "quake.zip" and put the generated folder called "quake" in cstrike/sound
  4. put plugin.quakesounds.txt in cstrike/addons/sourcemod/translations
  5. put quakesoundslist.cfg in cstrike/addons/sourcemod/configs
  6. compile quakesounds_<game>.sp in the forum by clicking the "Get Plugin" link
  7. put the generated quakesounds_<game>.smx in cstrike/addons/sourcemod/plugins

Configuration


1. for quakesoundslist.cfg

"headshot"
{
"0" <– (NOTE: plays the sound for every head shot) Number of Kills required to play the sound
{
"standard" "quake/headshot.mp3"
"female" "quake/female/headshot.mp3"
"config" "0"
}
"1" <– Number of Kills required to play the sound
{
"standard" "quake/headshot.mp3"
"female" "quake/female/headshot.mp3"
"config" "0"
}
}

"config" ""
The field works as follows:
0: Off
1: Play sound to everyone
2: Play sound to attacker
4: Play sound to victim
8: Print text to everyone
16: Print text to attacker
32: Print text to victim

You need to add the above values to get your value
If you want to play sounds and text to everyone 1 + 8 = 9
If you want to print text to everyone but only want sounds to play for those involved: 2 + 4 + 8 = 14

2. for plugin.quakesounds.txt

"headshot 1" <– 1 = Number of Kills required to play the sound
{
"#format" "{1:s},{2:s}"
"en" "{1} Headshot"
"de" "{1} Kopfschuss"
"fr" "{1} aime les grosses têtes !!"
}
"headshot 3" <– 3 = Number of Kills required to play the sound
{
"#format" "{1:s},{2:s}"
"en" "{1} Hattrick"
"de" "{1} Hattrick"
"fr" "{1} Tour du chapeau"
}


CVARS
  • sm_quakesounds_version: The version number
  • sm_quakesounds_enable [1/0]: Enables the plugin
  • sm_quakesounds_announce: Enables the plugin announcement
  • sm_quakesounds_text: The default text setting for new users
  • sm_quakesounds_sound: The default sound setting for new users


To Do List (Future Features):
Changelog
  • 2.7.5 - fixed a coding error. psychonic has been added as an author.
  • 2.7 - fixed some text display bugs and file and name length fixes
  • 2.61 - fixed client preferences support (!settings)
  • 2.60 - Text display fix
  • 2.50 - fixed client cookies problem [This is an important update]
  • 2.40 - fixed the join sound and client name problem by changing the file name length [This is an important update]
  • 2.30 - added a client check
  • 2.20 - fixed a logic issue [This is an important update]
  • 2.10 - fixed maxclients problem and stopped first blood sound playing for team kills
  • 2.00 - a fully working release
  • 1.02 beta - added DOD head shot support [Still needs testing]
  • 1.01 beta - added TF2 support bitches [Still needs testing]
  • 1.00 beta - Created plugin [Still needs testing]

Thank You
For Your Help:
exvel - helped with define and negative integer question
PM - helped with string referencing
SirLamer - helped with string referencing
psychonic - helped with TF2 support & DOD head shot support
Sgt-Mess - Tested with CSS
tcviper - fixed the join sound problem by changing the file name length
psychonic - pointed out the client names may be up to 64 characters long
psychonic - fixed client cookies problem
psychonic - added !settings support


Original plugin created by dalto

FredJed223 04-30-2009 17:02

Re: quake sounds [Revamped]
 
Any TF2 support?

psychonic 04-30-2009 19:25

Re: quake sounds [Revamped]
 
Quickie version of the above with TF2 support added. Will delete attachment at Grrrrrrrrrrrrrrrrrrr's request and/or if integrated into the main plugin.

shustas 05-01-2009 13:13

Re: quake sounds [Revamped]
 
I dont get it. So what is the diff between this and the old one? Is it only the way config files are organized? Im using CSS. The old one is not bad, just very rare times I cant hear any sounds. Does your version fix that?

Grrrrrrrrrrrrrrrrrrr 05-01-2009 13:39

Re: quake sounds [Revamped]
 
yes, it does. Basically, the new version has several bugs and logic issues fixed, is optimized for speed and memory, and has some configuration improvements. The logic issues are the biggest problem with the old version. (read the replies in the old version's post for examples)


I like the new version mainly because of how the plugin prioritizes events. And, I like the new configuration which makes everything editable. For example, the number of kills for head shots and combos.

shustas 05-01-2009 14:15

Re: quake sounds [Revamped]
 
cool then

Sgt-Mess 05-01-2009 19:56

Re: quake sounds [Revamped]
 
I will do some testing with this since I've been waiting for someone to fix dalto's plugin for quite some time now.

I remember there being one thing I could remember with daltos plugin, which was that the "Prepare to Fight" sound never played at the beginning of each round. Or it just wasn't included in his plugin.

silentpaul 05-02-2009 00:03

Re: quake sounds [Revamped]
 
is the dods head shots fixed in this version?

exvel 05-02-2009 03:27

Re: quake sounds [Revamped]
 
Grrrrrrrrrrrrrrrrrrr, I think the current method of setting game mod through recompiling is too tricky. You could simply use auto-detecting of game mods by the plugin. Something like this:
PHP Code:

decl String:gameName[80];
GetGameFolderName(gameName80);
    
if (
StrEqual(gameName"cstrike"))
{
    
// stuff for CS
}
else if (
StrEqual(gameName"dod"))
{
    
// stuff for DoD
}
else if (
StrEqual(gameName"tf"))
{
    
// stuff for TF
}
else if (
StrEqual(gameName"hl2mp"))
{
    
// stuff for HL2
}
else
{
    
// stuff for all other mods,
    // or you can force plugin to SetFailState here 
    // if other mods are not supported



Grrrrrrrrrrrrrrrrrrr 05-02-2009 05:23

Re: quake sounds [Revamped]
 
@Sgt-Mess: The included quakesoundslist.cfg has everything disabled by default. So, did you edit the config for the events you wanted to enable?

@exvel: The problem with your code is that it compiles with code for every mod and runs repetitive if statements. I know there is a default define called build_dod, but I don't know what the default define is for other mods. This would be that same as your code but with define statements since the define is set by sourcemod.

exvel 05-02-2009 06:32

Re: quake sounds [Revamped]
 
Quote:

Originally Posted by Grrrrrrrrrrrrrrrrrrr (Post 819195)
The problem with your code is that it compiles with code for every mod and runs repetitive if statements. I know there is a default define called build_dod, but I don't know what the default define is for other mods. This would be that same as your code but with define statements since the define is set by sourcemod.

This is a normal practice to include such "if" statements into the plugin. Such code will use maybe ~0.000000000000001% more CPU's resources then your code but it will be MUCH simpler for the server adminstrator to install. Only ~10% of all sourcemod admins know how to recompile plugins and only ~5% will do this AFAIK.
If you want to optimize your plugin you can use the integer variable to store current game name, for example:
PHP Code:

#define GAME_ANY 0
#define GAME_CS 1
#define GAME_TF 2
#define GAME_HL 3
#define GAME_DOD 4

new g_GameName 0;

// OnPluginStart:
decl String:gameName[30]; 
GetGameFolderName(gameNamesizeof(gameName)); 
     
if (
StrEqual(gameName"cstrike")) 

    
g_GameName GAME_CS;

else if (
StrEqual(gameName"dod")) 

    
g_GameName GAME_DOD;

else if (
StrEqual(gameName"tf")) 

    
g_GameName GAME_TF;

else if (
StrEqual(gameName"hl2mp")) 

    
g_GameName GAME_HL;

else 

   
g_GameName GAME_ANY;


// Somewhere in the code where you are using game specific functions:
if (g_GameName == GAME_CS

    
// do CS stuff here

else if (
g_GameName == GAME_DOD

   
// do DoD stuff here

else 
// ...  etc. 

p.s. "build_dod"??

psychonic 05-02-2009 09:44

Re: quake sounds [Revamped]
 
Quote:

Originally Posted by Sgt-Mess (Post 819110)
head shots don't play at all for me.

Grrrrrrrrrrrrrrrrrrr,

To hook DOD:S headshots, you have to use the player_hurt event.
PHP Code:

new bool:headshot = (GetEventInt(event"health") <= && GetEventInt(event"hitgroup") == 1); 


Grrrrrrrrrrrrrrrrrrr 05-02-2009 14:01

Re: quake sounds [Revamped]
 
@exvel: When I started working on superhero mod source from Anthony's code, I saw that he used BUILD_DOD without defining it in his code. So, I assumed that sourcemod auto detected the mod and defined BUILD_DOD. (Take a look at http://users.svn.alliedmods.net/view...ce&view=markup) So, if I'm right, what would the define be for css, tf2, and so forth? (Thanks for the help)

@psychonic: Thank you, I added your code in. Now, someone just needs to test the new code with DOD since I don't have DOD. (Sgt-Mess probably will test the code)

Sgt-Mess 05-02-2009 16:05

Re: quake sounds [Revamped]
 
I've got all the sounds set to play to everyone while testing and the only sounds that played back where "Combowhore, MultiKill, & FirstBlood"

This is all I saw in the logs.

Code:

L 05/02/2009 - 15:58:05: [SM] Plugin encountered error 15: Array index is out of bounds
L 05/02/2009 - 15:58:05: [SM] Displaying call stack trace for plugin "quakesounds.smx":
L 05/02/2009 - 15:58:05: [SM]  [0]  Line 467, /home/groups/sourcemod/upload_tmp/php50Qb4Z.sp::EventPlayerDeath()


exvel 05-02-2009 16:26

Re: quake sounds [Revamped]
 
Grrrrrrrrrrrrrrrrrrr, I think it is something like debug definitions for DoD functionality that were planed to add in the future so Anthony put DoD's code into #if statement. So BUILD_DOD isn't a sourcemod definition I think. Of course I can be wrong.

Sgt-Mess 05-02-2009 21:50

Re: quake sounds [Revamped]
 
Works great now thanks.

PStar 05-03-2009 15:46

Re: quake sounds [Revamped] (Version 2.00 / Updated May 2 2009)
 
How about making an Sp file for each supported mod in the first post?

Like:
sm_quakesound_css.sp
sm_quakesound_dod.sp
.
.
.
And so on... It wouldn't mess up the post infact it would make it easier to choose for server admins.

Sgt-Mess 05-03-2009 17:55

Re: quake sounds [Revamped] (Version 2.00 / Updated May 2 2009)
 
I think sounds under "killsound" should be the highest priority then all the other sounds cause if you got one more kill to go and get a knife, it will play humilation instead of "GodLike" or if you get two kills and only need one to get "GodLike" it will play multikill.

Also for css "HeadShot" still doesn't seem to be working I got the config set to "2"

Xp3r7 05-04-2009 10:04

Re: quake sounds [Revamped] (Version 2.00 / Updated May 2 2009)
 
What version of SM do you need for this?

I have SM 1.1.

Grrrrrrrrrrrrrrrrrrr 05-04-2009 12:49

Re: quake sounds [Revamped] (Version 2.00 / Updated May 2 2009)
 
The event priority list from highest to lowest priority:
  1. First blood
  2. Combo kills
  3. kills
  4. head shots
  5. grenades
  6. knife
@Sgt-Mess: Please attach your configuration file so I can see if there are any problems with it. Also, If you want the kills (killsound) to be first, I will change that for you.

@Xp3r7: Sourcemod 1.2 is the minimum requirement

@exvel: for now, I did what PStar suggested. But, I will use your code for my other plug-ins. thank you for the help.

Sgt-Mess 05-04-2009 16:09

Re: quake sounds [Revamped] (Version 2.00 / Updated May 2 2009)
 
1 Attachment(s)
Hurrr!!!! I'm only using the standard sounds, so I removed the rest from the list.

Grrrrrrrrrrrrrrrrrrr 05-04-2009 16:54

Re: quake sounds [Revamped] (Version 2.00 / Updated May 2 2009)
 
I edited my last post, post #21, because I forgot to write that first blood gets the highest priority.

Quote:

Originally Posted by Sgt-Mess (Post 820441)
... if you got one more kill to go and get a knife, it will play humilation instead of "GodLike"

I am not sure why this problem is present. I will do some testing and reply to you.

Quote:

Originally Posted by Sgt-Mess (Post 820441)
or if you get two kills and only need one to get "GodLike" it will play multikill.

This is the correct behavior of the plug-in. Do you want this behavior changed?

Quote:

Originally Posted by Sgt-Mess (Post 820441)
Also for css "HeadShot" still doesn't seem to be working I got the config set to "2"

If you want it to play the Head Shot sound for every head shot, change the 1 to 0. The configuration you currently have is set to play the Head Shot sound only for the 1st head shot. So, since you have the First Blood sound enabled and the First Blood sound has the highest priority, even if the first shot is a head shot, the First Blood sound will play.

Sgt-Mess 05-04-2009 17:26

Re: quake sounds [Revamped] (Version 2.00 / Updated May 2 2009)
 
Actually the knife thing doesn't happen, I just think that kill sounds should have a higher priority then combo sounds. Maybe you should wait to do it to see if someone else agrees.

Ok now headshots work I forgot that the number there was for kills, and not the number of sounds under that category.

Grrrrrrrrrrrrrrrrrrr 05-04-2009 20:57

Re: quake sounds [Revamped] (Version 2.00 / Updated May 2 2009)
 
ok.

Dark4eg 05-06-2009 04:00

Re: quake sounds [Revamped] (Version 2.00 / Updated May 4 2009)
 
Please help!
I'm using this plugin on the server, the sounds are downloaded the client but did not play!
In the console says: "file probably missing from disk / repository" ... how do I fix this?

My OS - Windows Serveer 2003.

Sgt-Mess 05-06-2009 04:02

Re: quake sounds [Revamped] (Version 2.00 / Updated May 4 2009)
 
Shows up in error logs

Code:

L 05/06/2009 - 04:00:46: [SM] Native "EmitSound" reported: Client index 0 is invalid
L 05/06/2009 - 04:00:46: [SM] Displaying call stack trace for plugin "quakesounds_css.smx":
L 05/06/2009 - 04:00:46: [SM]  [0]  Line 370, /home/groups/sourcemod/compiler-1.2/include/sdktools_sound.inc::EmitSoundToClient()
L 05/06/2009 - 04:00:46: [SM]  [1]  Line 591, /home/groups/sourcemod/upload_tmp/phpnErd7I.sp::PlayQuakeSound()
L 05/06/2009 - 04:00:46: [SM]  [2]  Line 336, /home/groups/sourcemod/upload_tmp/phpnErd7I.sp::EventRoundFreezeEnd()

Also First blood plays when someone is TK'd(teamkilled) I think that should be changed, if possible.

Grrrrrrrrrrrrrrrrrrr 05-06-2009 13:34

Re: quake sounds [Revamped] (Version 2.10 / Updated May 6 2009)
 
@Dark4eg: did you read the instructions, specifically step 3?

@Sgt-Mess: I fixed the team kill issue. (I'll send you your version with the issue fixed the next time I see you online in AIM or whatever IM)
For the error in your logs, if the configuration for round play is not set to 1, the plug-in shows that error. So, what is the configuration value for round play set to?

Sgt-Mess 05-07-2009 00:49

Re: quake sounds [Revamped] (Version 2.10 / Updated May 6 2009)
 
Quote:

Originally Posted by Grrrrrrrrrrrrrrrrrrr (Post 822402)
@Dark4eg: did you read the instructions, specifically step 3?

@Sgt-Mess: I fixed the team kill issue. (I'll send you your version with the issue fixed the next time I see you online in AIM or whatever IM)
For the error in your logs, if the configuration for round play is not set to 1, the plug-in shows that error. So, what is the configuration value for round play set to?

Oh I see, I accidentally set it to 2. So thats fixed.

Grrrrrrrrrrrrrrrrrrr 05-08-2009 21:11

Re: quake sounds [Revamped] (Version 2.20 / Updated May 8 2009)
 
Updated: 2.20 - fixed a logic issue [This is an important update]

Xp3r7 05-08-2009 23:01

Re: quake sounds [Revamped] (Version 2.20 / Updated May 8 2009)
 
To update this, all we download is the .smx and the .sp correct?

.smx goes in the plugins folder
.sp goes in the scripting folder

Shiverwarp 05-09-2009 20:17

Re: quake sounds [Revamped] (Version 2.20 / Updated May 8 2009)
 
Just updated this and getting errors...

18:13:21 L 05/09/2009 - 19:12:25: [SM] Native "RegClientCookie" reported: Clientprefs is disabled due to a failed database connection
18:13:21 L 05/09/2009 - 19:12:25: [SM] Displaying call stack trace for plugin "quakesounds_tf2.smx":
18:13:21 L 05/09/2009 - 19:12:25: [SM] [0] Line 127, /home/groups/alliedmodders/forums/files/3/2/0/5/6/41903.attach::OnPluginStart()

Dark4eg 05-10-2009 04:54

Re: quake sounds [Revamped] (Version 2.20 / Updated May 8 2009)
 
i am have this error...
Quote:

L 05/10/2009 - 12:46:29: [SM] Native "IsFakeClient" reported: Client 4 is not connected
L 05/10/2009 - 12:46:29: [SM] Displaying call stack trace for plugin "quakesounds_css.smx":
L 05/10/2009 - 12:46:29: [SM] [0] Line 388, quakesounds_css.sp::OnClientCookiesCached()

Timiditas 05-10-2009 15:08

Re: quake sounds [Revamped] (Version 2.20 / Updated May 8 2009)
 
Same problem as with old Quakesound1.8 plugin.
!quake or /quake does NOT work.
Console says: Unknown command

Also I get this console error on joining the server:
Failed to load sound "admin_plugin\actions\timi_joi", file probably missing from disk/repository
While the quakesoundslist.cfg says this:
Code:

    "join server"
    {
        "standard"        "admin_plugin/actions/timi_joinserver_kaese.mp3"
        "female"        "admin_plugin/actions/timi_joinserver_kaese.mp3"
        "crappy music"    "admin_plugin/actions/timi_joinserver_kaese.mp3"
        "config"        "1"
    }


Shiverwarp 05-10-2009 15:56

Re: quake sounds [Revamped] (Version 2.20 / Updated May 8 2009)
 
Alright I fixed my error I was having before, just had to set up my clientprefs database correctly

Timiditas 05-10-2009 16:05

Re: quake sounds [Revamped] (Version 2.20 / Updated May 8 2009)
 
Quote:

Originally Posted by Shiverwarp (Post 825109)
Alright I fixed my error I was having before, just had to set up my clientprefs database correctly

Sorry, I'm new to that stuff. How do you do that?

Grrrrrrrrrrrrrrrrrrr 05-10-2009 18:48

Re: quake sounds [Revamped] (Version 2.30 / Updated May 10 2009)
 
Quote:

Originally Posted by Dark4eg (Post 824749)
i am have this error...

I fixed the problem. Download the newest version of this plug-in.

Quote:

Originally Posted by Timiditas (Post 825074)
Same problem as with old Quakesound1.8 plugin.
!quake or /quake does NOT work.
Console says: Unknown command

Also I get this console error on joining the server:
Failed to load sound "admin_plugin\actions\timi_joi", file probably missing from disk/repository
While the quakesoundslist.cfg says this:
Code:

    "join server"
    {
        "standard"        "admin_plugin/actions/timi_joinserver_kaese.mp3"
        "female"        "admin_plugin/actions/timi_joinserver_kaese.mp3"
        "crappy music"    "admin_plugin/actions/timi_joinserver_kaese.mp3"
        "config"        "1"
    }


For the first problem, try just "quake." But, I will double check and add those commands if there not working. For the second problem, I'm not sure. I will test it and reply back to you.

Dark4eg 05-11-2009 03:22

Re: quake sounds [Revamped] (Version 2.30 / Updated May 10 2009)
 
Quote:

Originally Posted by Grrrrrrrrrrrrrrrrrrr (Post 825178)
I fixed the problem. Download the newest version of this plug-in.

Ok! Thanks for fix this havy problem. In tested new version.:)

Timiditas 05-11-2009 09:44

Re: quake sounds [Revamped] (Version 2.30 / Updated May 10 2009)
 
Quote:

Originally Posted by Grrrrrrrrrrrrrrrrrrr (Post 825178)
For the first problem, try just "quake." But, I will double check and add those commands if there not working.

The problem seems only to arise if there are more than two soundsets configured in the soundlist. Same behaviour as old Quake1.8 plugin.

No further information on the other problem yet. Maybe its a problem specific to the loaded plugins constellation on my server. I will test your plugin standalone tomorrow.

Timiditas 05-11-2009 13:58

Re: quake sounds [Revamped] (Version 2.30 / Updated May 10 2009)
 
Well the "first" of the problems is solved. A flawed quake plugin configuration is, what triggers it.
I had defined a third soundset in the soundlist.cfg, but did NOT change the file plugin.quakesounds.txt in translations directory. That particular file had also a third set called "german sounds", and the soundslist.cfg referenced the third set as "crappymusic".
I got no error message from your plugin on the client (except the "unknown command" fraud), neither in the server log files. Thats why I couldn't find the cause. Only a login via HLSW revealed what was amiss, because there in the HLSW console, the server spat out the relevant error at last; that there was no reference to "crappymusic" in the phrases textfile.

I think in that situation, this message should be posted to the client as well.
I don't know if that lies within the bounds of the possibilities of a sourcemod plugin; the error message in the console didn't originate from the plugin but from sourcemod itself. Is it possible to implement an error handler within the menu creation function?

Shiverwarp 05-12-2009 01:06

Re: quake sounds [Revamped] (Version 2.30 / Updated May 10 2009)
 
Are the female sounds working for everyone else?


All times are GMT -4. The time now is 16:07.

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