Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin

DoD Weapon Jam (v3.0)

by diamond-optic · 2007-08-28 · 26 replies · 23451 views · 89 downloads

Read the thread (27 posts)

From the first post

DoD Weapon Jam
n- Version 3.0
n- 07.22.2009
n- diamond-optic
n
nCredits:
n
- Wilson [29th ID] (pdata offsets as well as a ton of other help)
Information:
n
- Weapons will randomly jam and the client will have to pressn their use key to clear the chamber (or reload depending on setting)nn- Sometimes clearing the chamber fails, requiring multiple attemptsn- Chance of weapon jamming permanentlyn- Specific weapon stays jammed even after dropping itn- Enable/Disable losing 1 round in the clip when clearing the chambern- Weapons will not jam on a full clip (so you dont spawn with a jammed weapon)nn- Server List: [URL]http://www.game-monitor.com/search.php?rulename=dod_weaponjam_stats[/URL]
Commands:
n
dod_weaponjam_force //Force a clients weapon to jamn //Enter a trailing 1 for perm jam
CVARs:
n
SETTING_MSGSTYLE 3    //Message Style Settingn                        //1 = HUD Messagesn                        //2 = Chat Messagesn                        //3 = Both HUD & Chat MessagesnnSETTING_CHANCE 1200    //Chance of weapon jamming for each shot (1 in ### chance)nnSETTING_RELOAD 1      //Reloading clears jammed weapons (on(1)/off(0))nSETTING_AMMO 1        //Clearing chamber subtracts 1 round of ammo (on(1)/off(0))nnSETTING_PERM 50      //Chance of weapon jam to be permanent (0 = no perm jam)nSETTING_FAIL 4       //Chance of clearing chamber failing (0 = always clears 1st time, 1 in ### chance)nnSETTING_MAXPLAYERS 32    //Set to the number of slots your server has
Change Log:
n
- 07.23.07 - Version 1.0n    Initial Releasenn- 09.12.07 - Version 1.1n    Adjusted default jam chances just slightlyn    Stopped 'jammed' sounds from playing after round endn    Added CVAR to control message stylen    Fixed jam sound from overlapping itselfnn- 01.29.08 - Version 2.0n    Huge Rewrite, too many changes to listnn- 07.22.09 - Version 3.0n    Added command to force someones weapon to jamn    Changed prethink forward over to HamSandwichn    Removed CVAR to enable/disable jamming, just dont load the plugin insteadn    Changed CVARs to compiler definesn    Bots will now get jamsn    Changed some default valuesn    Decreased weapon ent search radius to stop affecting of guns on the groundn    Improved some if statementsn    Removed 'Full Precache' ability as it doesnt seem to be an issuen    Various other code improvements
DOWNLOAD MIRROR: http://www.avamods.com/download.php?view.155

Files

dod_weaponjam.sma Plugin Source 16 KB 89 dl Download Compile

The thread

All 27 posts from 7 people on DoD Weapon Jam (v3.0), kept as they were written.

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
08-28-2007, 03:00 PM #1

DoD Weapon Jamn- Version 3.0n- 07.22.2009n- diamond-opticnnCredits:n

n- Wilson [29th ID] (pdata offsets as well as a ton of other help)n
Information:n
n- Weapons will randomly jam and the client will have to pressn their use key to clear the chamber (or reload depending on setting)nn- Sometimes clearing the chamber fails, requiring multiple attemptsn- Chance of weapon jamming permanentlyn- Specific weapon stays jammed even after dropping itn- Enable/Disable losing 1 round in the clip when clearing the chambern- Weapons will not jam on a full clip (so you dont spawn with a jammed weapon)nn- Server List: http://www.game-monitor.com/search.php?rulename=dod_weaponjam_statsn
Commands:n
ndod_weaponjam_force <nick/steam> <perm> //Force a clients weapon to jamn //Enter a trailing 1 for perm jamn
CVARs:n
nSETTING_MSGSTYLE 3    //Message Style Settingn                        //1 = HUD Messagesn                        //2 = Chat Messagesn                        //3 = Both HUD & Chat MessagesnnSETTING_CHANCE 1200    //Chance of weapon jamming for each shot (1 in ### chance)nnSETTING_RELOAD 1      //Reloading clears jammed weapons (on(1)/off(0))nSETTING_AMMO 1        //Clearing chamber subtracts 1 round of ammo (on(1)/off(0))nnSETTING_PERM 50      //Chance of weapon jam to be permanent (0 = no perm jam)nSETTING_FAIL 4       //Chance of clearing chamber failing (0 = always clears 1st time, 1 in ### chance)nnSETTING_MAXPLAYERS 32    //Set to the number of slots your server hasn
Change Log:n
n- 07.23.07 - Version 1.0n    Initial Releasenn- 09.12.07 - Version 1.1n    Adjusted default jam chances just slightlyn    Stopped 'jammed' sounds from playing after round endn    Added CVAR to control message stylen    Fixed jam sound from overlapping itselfnn- 01.29.08 - Version 2.0n    Huge Rewrite, too many changes to listnn- 07.22.09 - Version 3.0n    Added command to force someones weapon to jamn    Changed prethink forward over to HamSandwichn    Removed CVAR to enable/disable jamming, just dont load the plugin insteadn    Changed CVARs to compiler definesn    Bots will now get jamsn    Changed some default valuesn    Decreased weapon ent search radius to stop affecting of guns on the groundn    Improved some if statementsn    Removed 'Full Precache' ability as it doesnt seem to be an issuen    Various other code improvementsn
DOWNLOAD MIRROR: http://www.avamods.com/download.php?view.155

=|[76AD]|= TatsuSaisei
posted here
Posts: 794
Threads: 54
Joined: May 2005
08-28-2007, 08:46 PM #2

w00t !! first to download this...

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
08-30-2007, 10:04 PM #3

ok there seems to be some problem with some of the new attachments on the forums.. so likely this will download as an empty file.. nnif it does.. try the download mirror link that points to my website :D

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
09-01-2007, 12:20 AM #4

ok zor said the webspace or whatever kinda ran out lol.. so he deleted some stuff and i just re-attached the plugin and it should be working fine now :Dnnthanks zor!

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
09-12-2007, 08:28 PM #5

Update to Version 1.1nn

- 09.12.07 - Version 1.1n        Adjusted default jam chances just slightlyn        Stopped 'jammed' sounds from playing after round endn        Added CVAR to control message stylen        Fixed jam sound from overlapping itself
K knife108
posted here
Posts: 108
Threads: 10
Joined: Apr 2006
09-17-2007, 05:50 AM #6
Update to Version 1.1rnrn
- 09.12.07 - Version 1.1rn        Adjusted default jam chances just slightlyrn        Stopped 'jammed' sounds from playing after round endrn        Added CVAR to control message stylern        Fixed jam sound from overlapping itself
rnrni d used but didnt find much different between v1.0 except message style rnrn:prnrnthe 1st bullet always been jamed when u spawn just have no time to fire.rnrnanother , when u fix the jamed weapon it will fire only one bullet out!rnrnGo on D.O !

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
09-17-2007, 12:13 PM #7
the 1st bullet always been jamed when u spawn just have no time to fire.
nnive tested it extensively, even setting the cvars so it jams on each shot and it never once jammed for me on the 1st bulletnnnn
another , when u fix the jamed weapon it will fire only one bullet out!
nnwhat do you mean? cause for me its always worked 'fine' after unjamming it

Wilson [29th ID]
posted here
Posts: 623
Threads: 57
Joined: Oct 2005
09-17-2007, 02:21 PM #8

Quality rifles sold by Diamond-Optic Enterprises.rnrn"They never jam on the first shot!"

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
09-17-2007, 03:23 PM #9

lol ya it might be slightly more realistic to allow jamming on 1st shot.. but i found the annoyance (and complaints lol) of starting a round with a jammed weapon.. or reloading a weapon and having it be jammed right away to be something that for the sake of a game can be left out lol..nnplus idk.. if you're putting the clip/ammo in yourself and working the bolt manually there might be 'less' chance of a jam then the weapon working the bolt on its own (and expelling a spent shell at the same time..)

Wilson [29th ID]
posted here
Posts: 623
Threads: 57
Joined: Oct 2005
09-17-2007, 04:52 PM #10

Yeah I meant to comment on that. SMGs, namely the MP40 with its limiting vertical magasine, jammed a lot more frequently than, say, a Rifle. I've fired my M1 hundreds of times and it has never jammed. But SMGs, well, that's just what they do. They jam more than sam. And sam jams alot.

K knife108
posted here
Posts: 108
Threads: 10
Joined: Apr 2006
09-18-2007, 04:16 AM #11

to D.Ornrnrnrn1. starting the dod_forcetracers and dod_tracers ,if jamed and u do not fix it , force to fire the gun will shoot one bullet(tracer) everytime or push key "E" to fix it the gun will shoot a bullet(tracer) either :prnrn2. if jamed and u do not push key "E" to fix it , just force to fire 10 times or more the jam will be fixed by itself and the clip/ammo will decrease :prnrnrnrnotherwise idk...different guns should have different frequence of jam.

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
09-18-2007, 05:04 AM #12

alright checking it out with dod_tracers...nnnot having any 'real' trouble with jamming/unjamming/shooting...nfor me its just showing the tracer when it shouldnt, so if i get around to it ill look at it more tomorrow when i get up since its 4am here now

K knife108
posted here
Posts: 108
Threads: 10
Joined: Apr 2006
09-18-2007, 05:44 AM #13
to D.Ornrnrnrn1. starting the dod_forcetracers and dod_tracers ,if jamed and u do not fix it , force to fire the gun will shoot one bullet(tracer) everytime or push key "E" to fix it the gun will shoot a bullet(tracer) either :prnrn2. if jamed and u do not push key "E" to fix it , just force to fire 10 times or more the jam will be fixed by itself and the clip/ammo will decrease :prnrnrnrnotherwise idk...different guns should have different frequence of jam.
rnrnrnv1.1 has both 2 problem and v1.0 only has 1st.rnrnI still used the v1.0 but it has the problem that u'll have a jamed gun sometimes when u spawn.rnrnmy cvar for v1.0:rn
rnrndod_weaponjam "1"rndod_weaponjam_chance "98"rndod_weaponjam_reload "1"rndod_weaponjam_perm "25"	rndod_weaponjam_fail "3"rnrn
diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
09-18-2007, 02:09 PM #14

hmm there wasnt really anything done to the actual jamming/clearing part between the versions so i dont see how it could have changed lol

K knife108
posted here
Posts: 108
Threads: 10
Joined: Apr 2006
09-18-2007, 09:50 PM #15
hmm there wasnt really anything done to the actual jamming/clearing part between the versions so i dont see how it could have changed lol
rnrnya it's really :confused: rnrndo u have any idea about the jammed gun when u spawn ? rn:o

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
03-21-2008, 03:45 AM #16

UPDATED TO VERSION 2.0nnI HIGHLY RECOMMEND THAT ANYONE RUNNING v1.x UPDATE TO THIS VERSION!nnnthis version fixes all known problems with the 1.x versions and after running this plugin for almost 2 months straight on my server I am convinced that there are no more major flaws in it (as of yet at least lol) so this should be totally fine to run now and im pulling it back out of the test forum :cool:n

D dlambert1989
posted here
Posts: 24
Threads: 2
Joined: Dec 2006
04-24-2008, 04:12 PM #17

I tried to compile this plugin using the compiler on amxmodx.org and it gave me this:rnrnYour plugin failed to compile! Read the errors below:rnrnWelcome to the AMX Mod X 1.76-300 Compiler.rnCopyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Teamrnrn/home/groups/amxmodx/tmp3/phpAmOYTm.sma(433) : error 088: number of arguments does not match definitionrnrn1 Error.rnCould not locate output file /home/groups/amxmodx/public_html/websc3/phpAmOYTm.amx (compile failed).

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
04-24-2008, 05:58 PM #18

i believe the online compiler on amxmodx.org isnt up to datennit works fine using the one here to compile it for 1.8.xnhttps://www.dodplugins.net/forums/index.php?page=helpnnbut it gives me that error when using older versions, so if you need it for an older version let me know and ill fix it for you

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
07-22-2009, 09:49 PM #19

Updated to v3.0nn

- 07.22.09 - Version 3.0n    Added command to force someones weapon to jamn    Changed prethink forward over to HamSandwichn    Removed CVAR to enable/disable jamming, just dont load the plugin insteadn    Changed CVARs to compiler definesn    Bots will now get jamsn    Changed some default valuesn    Decreased weapon ent search radius to stop affecting of guns on the groundn    Improved some if statementsn    Removed 'Full Precache' ability as it doesnt seem to be an issuen    Various other code improvements
Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
07-23-2009, 01:19 PM #20

whats up with the macros? are they better? if yes how so?

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
07-23-2009, 05:47 PM #21

well the main reason im doing that with the majority of my plugins is because i basically just am tailoring stuff to my own needs now and im no longer concerned with making things simple and easy or whatever for every random person that might want to run my plugins... In most cases just compiling the plugin with the default settings will be just fine for everyone, but for so called power users i think it gives a little bit more of an effecient way to do thingsnnbut anyway, i figure with most settings that were cvars.. most people probably didnt change them from the default values, and if they did they would change them once or twice and then leave the values forever.. So i figure theres no need to be reading these cvars all the time when the values are never changing.. Especially with plugins like this one where theres stuff done in prethink, so i would assume that already having the values compiled right in the plugin is a lot better then reading cvars every single server frame when the values arent changingnnplus with some things, where the cvar would turn on/off certain features, instead of constantly checking those cvars and having it return say false and have the plugin skip the code for that feature, using defines allows the plugin to be compiled without that code even in it, creating a smaller memory footprint at the same time (tho tiny in most cases but when doing that with a large number of plugins it can be a noticably decrease in usage) and also removing the need to bother checking that cvar over and overnnnow originally i figured id just cache the cvar values on say round start and read them from variable through out the round, but then i figured ehh it would probably be a little better to not even bother with cvars at all for most things... and now days since im not around much anymore, especially when it comes to working on plugins or anything, i figure im gonna make my server a priority over making things easier for other people lol, so im sacrificing simplicity and easier customization to make my own server more effecient (which i think has helped on my server running like 75+ plugins, used to get crashes several times a day, now it crashes like once every few days)nnnand the maxplayers define, is mostly used for array sizes.. leaving it at 32 will be just fine (as it would be maxplayers+1 for the array which would be like doing the normal value of 33) but for example my server is 25 slots, so setting it to 25 and making the array sizes 26 instead of 33 across several variables and then again thru several plugins makes those arrays only as big as they need to be instead of making them all 33 when theres cells that wont be used at all.. nothing major but just a little optimization that adds up when done thru several dozen pluginsnnnnbut using the defines instead of cvars might not be the most user-friendly thing to do, but i dont really care anymore haha

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
07-23-2009, 07:38 PM #22

ok well just what i expected you would answer :D Well personly i dont give jack about the, sometimes extra, amout of cells in the arrays, since the amount of memory one cell takes, is very very very, very small. I just use static cells when i can. rnrnOne thing that have helped on my server, is reducing native calls, by setting a value for each client when they join or leave eg.rnrnrncheers and thanks for the big ass answer :D

N netmad
posted here
Posts: 24
Threads: 5
Joined: May 2009
09-25-2009, 01:34 AM #23

1 little porblem , in fact Webley dont Jam, because it can jump on 1 bad Bullet ,and next bullet. ^_^ ,so del webley Jam chance

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
09-27-2009, 08:15 PM #24

not sure exactly what youre saying.. you mean how sometimes you can still get a shot or so off right when a gun jams?nnit happens with pretty much all the weapons but it seems to be quite rare for me (more common with automatics) and i dont see it as a huge drawback..nnand as for "Webley dont Jam" ...it jams fine for me

N netmad
posted here
Posts: 24
Threads: 5
Joined: May 2009
09-27-2009, 09:47 PM #25

sorry,I means that Webley is a kind of revolver 。if it jams,dont repair ,only go on shot ,then bullet of jams auto round to next。

K knife108
posted here
Posts: 108
Threads: 10
Joined: Apr 2006
09-29-2009, 10:00 PM #26

i'd like use the dod_jam.txt .rnrnit's easy to translate into another language.

diamond-optic
started this thread
Posts: 2,068
Threads: 103
Joined: May 2005
10-04-2009, 10:44 PM #27
sorry,I means that Webley is a kind of revolver 。if it jams,dont repair ,only go on shot ,then bullet of jams auto round to next。
nnnohh i see what you mean.. kinda embarrassed that i never thought of that

DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC