Thread: Weapon Jam..
View Single Post
  #41 (permalink)   diamond-optic is Special  
Old February 1st, 2008
diamond-optic's Avatar
diamond-optic diamond-optic is offline
i dont want a goldfish
 
Join Date: March 13th, 2005
Location: Upstate New York
Status: hazey
Posts: 3,259
Default

and obviously auto's will jam more often just due to the number of shots fired

a basic explantion of how jamming works:

PHP Code:
1000
50

if(random_num(1,x) == && is_clip_notfull)
     {
     if(
random_num(1,y) == 1)
           
//perm jam
     
else
           
//normal jam
     


obviously thats not exactly how its coded in pawn and theres more to it then that.. but thats basically it for simple minded ppl


and to confuse you more.. heres the actual code from the CurWeapon function forward that does the actual jamming:
PHP Code:
    if(get_pcvar_num(p_plugin) && is_user_alive(id) && is_user_connected(id) && !is_user_bot(id))
        {
        new 
wpnid dod_get_weapon_ent(id)
        new 
is_jammed pev(wpnid,pev_iuser4)
        
        if(
wpnid && pev_valid(wpnid))
            {
            
set_pev(wpnid,pev_iuser3,0)
            
            if(
is_jammed)
                
set_pdata_float(wpnid,OFFSET_WPN_PROF,100.0,OFFSET_LINUX)    
            else if(
is_clip_notfull(id))
                {
                if(
random_num(1,get_pcvar_num(p_chance)) == 1)
                    {
                    new 
perm get_pcvar_num(p_perm)
                    
                    if(
perm && random_num(1,perm) == 1)
                        
set_pev(wpnid,pev_iuser4,2)
                    else
                        
set_pev(wpnid,pev_iuser4,1)
                    }
                }
            }    
        } 

and every weapon can jam except nades/rockets/melee.. tho there is a chance that occasionally if you switch weapons at the exact right time as your gun is jamming that it will still fire off the forward but when it gets the wpn entity id you have the new weapon out and it picks up that.. but that should be very very rare



and..
Quote: Originally Posted by BuLLeT View Post
the Tommy gun jammed on me again the other day with the first shot...

whats your point.. you fired a shot and it jammed.. it didnt start off jammed, im positive of that.. next time maybe you should clean your weapon better and/or load the magazine properly

Quote: Originally Posted by ThePowerCosmic in regards to AvaMods
They are the type of people that are absolutely destroying the fabric of america and everything that goodness stands for.


Last edited by diamond-optic; February 1st, 2008 at 08:18 PM.
Reply With Quote