Raised This Month: $105 Target: $400
 26% 

Weapon Jams Ver 0.4


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   Hawk552 (427)
The Specialist
BANNED
Join Date: Nov 2006
Old 11-05-2006 , 16:22   Weapon Jams Ver 0.4
Reply With Quote #1

This plugin is made to simulate a real life common problem with weapons , the all to familiar , Weapon Jam. AKA Weapon malfunction. It has a cvar where you can set the ratio of bullets to malfunction ratio. The default is 200( shots per person berfore jamming) . And just like in real life you must clear the chamber before being able to shoot again . Press use to clear the chamber , and when the gun jams an empty weapon sound plays . then when you press use to clear the chamber , a bultpull sound plays . It only jams the weapon you had out. You can switch weapons and back and only the gun you had out will be jammed, till you clear it . Bots will jam the same way , except automatcily clear there chamber.

Bugs : None , this runs perfectly with no run time errors . Alot of testing

Next version will include : Ultimate sound type for jams . Random cvar to generate a completley random jam . And support for TS?


Requires Amxmodx : 1.76b (has to support PCVARS and set_cd)


Cvars :
amx_weapon_jam "1" or "0" | 1 is on 0 is off
amx_jam_ratio "200" how many shots before jam (test it first to find the setting you like)

Use Button : Clears A Jammed Chamber

Modules Required :
<amxmodx>
<fakemeta>


Installation : Install Like Any Other Plugin

Versions :
0.1 - The first release
0.2 - Added pcvars in place of old cvar sytem (Tested And Works)
0.3 - Added Weapon Specific Jam, Only Jammes Gun You Were Holding(so you can switch weps)(Tested And Works)
0.4 - Added Support to Execute Jam On Bots And Clear(Tested And Works)



Tested On Cstrike And Condition Zero
Attached Files
File Type: sma Get Plugin or Get Source (weapon_jam.sma - 3417 views - 4.3 KB)

Last edited by The Specialist; 12-06-2006 at 18:21.
The Specialist is offline
Send a message via AIM to The Specialist
Xerxes
Member
Join Date: Jun 2005
Old 11-05-2006 , 16:58   Re: Weapon Jams
Reply With Quote #2

not bad.
Xerxes is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-05-2006 , 17:19   Re: Weapon Jams
Reply With Quote #3

Thanks this is especially fun when your in the midlle of a shoot out and somebodys gun jammes. Loads of fun
The Specialist is offline
Send a message via AIM to The Specialist
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-05-2006 , 17:38   Re: Weapon Jams
Reply With Quote #4

Nice work. I'd suggest the ability to specify a random range of shots fired before jam (ie: 180-360), instead of a static amount.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 11-05-2006 , 17:39   Re: Weapon Jams
Reply With Quote #5

Knives can jam?
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
The Specialist
BANNED
Join Date: Nov 2006
Old 11-05-2006 , 17:49   Re: Weapon Jams
Reply With Quote #6

Avalanche @ Thank you I was thinking about a more random way to do this . I think ill start working on a random cvar to generate a completley random jam. Although when your in game , and your gun jams , it seems pretty random .

Lord Destros @ yes, im thinking about maybee getting more weapon specific next version . so that you can switch to your sidearm or knife and still kill while your main gun is jammed . I wanted to get some feedback on this version first to see what ideas people have .

Thanks for all the feedback guys any ideas will be grealty appreciated

Last edited by The Specialist; 11-05-2006 at 18:01.
The Specialist is offline
Send a message via AIM to The Specialist
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 11-05-2006 , 18:52   Re: Weapon Jams
Reply With Quote #7

realy nice man i just request add pcvars.
k007 is offline
Send a message via MSN to k007
The Specialist
BANNED
Join Date: Nov 2006
Old 11-05-2006 , 19:25   Re: Weapon Jams
Reply With Quote #8

yes actually i tried to use pcvars instead of the regualar cvars. But somewhere my varialbe for the pcvars lost its value , cause it didnt work . So i used this way because this was reliable. The script was very hard to make work perfectly , so i did what worked LOL . thank you for your support. Maybee someone can help me get the pcvars to work releaibly on the next version
The Specialist is offline
Send a message via AIM to The Specialist
diamond-optic
Veteran Member
Join Date: May 2005
Location: Upstate New York
Old 11-05-2006 , 19:36   Re: Weapon Jams
Reply With Quote #9

you have it labeled as "ALL" mods.. when in fact you use cstrike specific stuff...

cstrike sounds, and cstrike weaponids


and it would probably be more realistic to have it randomly jam instead of right after the cvar value number of shots..
__________________

Last edited by diamond-optic; 11-05-2006 at 19:41.
diamond-optic is offline
Send a message via AIM to diamond-optic
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 11-05-2006 , 19:39   Re: Weapon Jams
Reply With Quote #10

Quote:
Originally Posted by The Specialist View Post
yes actually i tried to use pcvars instead of the regualar cvars. But somewhere my varialbe for the pcvars lost its value , cause it didnt work . So i used this way because this was reliable. The script was very hard to make work perfectly , so i did what worked LOL . thank you for your support. Maybee someone can help me get the pcvars to work releaibly on the next version
Try this

Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> // global shot varaible new g_iShots[33]; new cvar, ratio; public plugin_init() {     register_plugin("Weapon Jam","0.1","The Specialist");     cvar = register_cvar("amx_weapon_jam","1");     ratio = register_cvar("amx_jam_ratio","200");     register_event("CurWeapon", "weapon_event", "be", "1=1", "3>0", "2!4", "2!6", "2!9", "2!25", "2!29");     register_forward(FM_PlayerPreThink, "weapon_jam");     register_forward(FM_UpdateClientData, "weapon_jam_update", 1); } // current weapon event public weapon_event(id) {     // if plugin is off end function         if(get_pcvar_num(cvar)== 0)     {         return PLUGIN_HANDLED;     }else{                  // if shots < ratio cvar increment varaible                 if(g_iShots [id]<= get_pcvar_num(ratio))         {             ++g_iShots[id];             jam_sounds(id);         }     }     return PLUGIN_CONTINUE; } // pre-think public weapon_jam(id ) {        // if shots == cvar execute functions         if( g_iShots[id]  >= get_pcvar_num(ratio)&& is_user_bot(id)==0)     {         // show messages                 set_hudmessage(255, 255, 255, -1.0, 0.33, 0, 6.0, 12.0)         show_hudmessage(id, "Weapon Jam Press Use To Clear")                 // block attack button                 set_pev( id, pev_button, pev(id,pev_button) & ~IN_ATTACK );                 // execute clear chamber and sounds                 clear_chamber(id);     }     return FMRES_HANDLED; } // client update data public weapon_jam_update(id,sendweapons,cd_handle ) {        // if shots are = cvar execute functions         if(  g_iShots[id] >= get_pcvar_num(ratio)&& is_user_bot(id)==0)     {         // show messages                 set_hudmessage(255, 255, 255, -1.0, 0.33, 0, 6.0, 12.0)         show_hudmessage(id, "Weapon Jam Press Use To Clear")                 // block weapon cd id                 set_cd(cd_handle, CD_ID, 0);                    // clear chamber and play sounds                 clear_chamber(id);         return FMRES_HANDLED;     }     return FMRES_HANDLED; } public jam_sounds(id) {     // if shots is = cvar execute function         if( g_iShots [id]>= get_pcvar_num(ratio)&& is_user_bot(id)==0)     {         // play sounds                 emit_sound(id,CHAN_AUTO, "weapons/dryfire_rifle.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);     } } public clear_chamber(id) {     // if user presses use button execute functions         if(pev(id,pev_button) &  IN_USE )     {               //re-set varaible to 0                 g_iShots[id] = 0;                 // play sounds                 emit_sound(id,CHAN_AUTO,"weapons/m4a1_boltpull.wav",1.0,ATTN_NORM,0,PITCH_NORM);                 // show messages                 set_hudmessage(255, 255, 255, -1.0, 0.3, 0, 6.0, 12.0);         show_hudmessage(id, "Chamber Clear");                 // and stop functions                 return PLUGIN_HANDLED;     }     return PLUGIN_HANDLED; }
Deviance is offline
Reply


Thread Tools
Display Modes

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 04:13.


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